Time to learn about some more HTML tags!
Emphasizing text: bold and italic
There are two classic ways to emphasize certain parts of your text: put it in bold or in italic.
To put some words in bold, place them between <strong> tags, like this:
<strong>this text will show up bold</strong>
To put words in italic, use the <em> tag, like this:
<em>this text will show up in italic</em>
Easy! Remember, it is ok to nest HTML tags, so you can do something like this without trouble:
<p> This is a paragraph of text. <strong>This phrase is bold, and <em>this word is bold AND italic</em> while this is again only bold. </p>
Headers of different importance
Ordered lists and unordered lists
Another common element of typography is the list. You use a list whenever you want to sum up something. Lists can be ordered and have numbers in front of each item, or unordered, with bullet points.
An unordered list is specified using the <ul> tag, with <li> tags for each list item (List Item… get it?), like this:
And here is how that would look in a browser:
An ordered list is specified using the <ol> tag, with again <li> tags for each list item:
Steps to master building web sites: <ol> <li>Launch browser</li> <li>Browse to webcodingforidiots.com</li> <li>Open my text editor</li> <li>Type whatever the hell Web Coding For Idiots tells me to type.</li> </ol>
And here is how the ordered list would look in a browser. The items get numbered automatically:
That’s it! Happy formatting your text!
Because sometimes a simple list doesn’t cut it, we’ll get you swimmin’ in even more tags in our next lesson about HTML tables.