How do you format text in HTML...?


The following pages show you some of the tags used for webpage text formatting.

Learn to make a website people

HTML Text Styles and formatting

The H1 - H6 header tags

HTML has six levels of predefined headings numbered 1 through 6. Headers are simple forms of text formatting that vary text sizes based on the header's level. The Size varies from one browser to another. These are paired tags and the syntax is as follows:

<h1>This is a h1 header</h1>
Check out the example here.

Text Styles

HTML provides a numerous range of tags for formatting the text. If you want to format the text with different styles, just include your text between these tags. For example the <b> tag is used to bold the following text. So <b>welcome to 123makeawebsite.com</b> will render the text between thes tags bold or
welcome to 123makeawebsite.com .

<b> BOLD

<b>This is a Bold element</b>
This is a Bold element

<i> ITALIC

<i>This is an italic element</i>
This is an italic element

<u> UNDERLINE

<u>This will underline the text</u>
This will underline the text

<s> STRIKE

<s>This will strike through the text</s>
This will strike through the text

Nested Text Styles

Tags located within other tags is called tag nesting. HTML allows the nesting of tags, but you should be careful about ending tag sequence correctly. For example if you want "TEXT" to be displayed in Italics with bold and underline format then you could nest tags as follows:

<i><b><u>This will be an underlined, bold and italic text</u></b></i>
Alternativly it can be wriiten like so for easier comprehension, but its still is displayed the same way in the webpage:
<i>
  <b>
    <u>
    This will be an underlined, bold and italic text
    </u>
  </b>
</i>
This will be an underlined, bold and italic text

Check out all the examples here.

Site designed by Pro-WebDesign