Formatting
All of tags introduced in this section always appear within the <body> and </body> tags.
<b></b>
The <b> and </b> HTML tags are used to make text bold. The tags can be used to cover any span of text you want to, or they can be used on as little as one letter.
<b>This text is bold</b>
This text is bold
<i></i>
The <i> and </i> tags are used to make text italic. These tags are used in a similar fashion as bold tags, except the effect is different.
<i>This is italic text</i>
This is italic text
<u></u>
The <u> and </u> tags will render text as underlined.
<u>This text is underlined</u>
This text is underlined
The bold, italic, and underline tags are very commonly used for simple formatting. They can be used as many times as you like on a page, and they can even be combined.
The following text is <b><i>Bold and Italic</i></b>
The following text is Bold and Italic
Take note the order the tags appear. The <b> bold is first, followed by the <i> italic tag, but in closing the tags </i> italic is first and </b> bold is second. In this case, a browser would still render the text properly if the tags were out of order, but it is good practice, and good for readability, to open and close tags in the proper order.
Now, let’s see what the bold, italic, and underline text look like in adding to our simple HTML example shown previously.
<html> <head> <title>Page Title</title> </head> <body> Hello, this is a <b>simple</b> example of <i>HTML</i>. You are well on your way <u>to learning more <i>about</i> HTML</u>. </body> </html>
Here is the output of this HTML code, as seen in a web browser:
Hello, this is a simple example of HTML. You are well on your way to learning more about HTML.
The “Page Title” text found between the title tags is found in the header bar of the HTML document.
Popularity: 3% [?]