There are quite a number of ways to specify text in HTML. In this section, we'll go over the most commonly used tags.
At the start of each text section, there should be a heading. In HTML, there are six heading levels, each with their respective closing tags:
<h1> is the top level heading, and should be used only once per page. The major topic goes to
<h1>, and a subtopic to
<h2>, and so on.
Following each heading, there should be some block of text. Usually this means a paragraph.
To specify a paragraph, we use the
<p> tag. Each paragraph tag should group sentences together that share some context.
<p>The platypus is a semiaquatic egg-laying mammal endemic to eastern Australia. It is one of the five extant species of monotremes, the only mammals that lay eggs instead of giving birth. It is the sole living representative of its family (Ornithorhynchidae) and genus (Ornithoryhynchus).</p>
To indicate that some text should be semantically emphasized, use the
The difference between the two tags is that
<em> indicates emphasis, while
<strong> indicates stronger emphasis.
If you play around with the strong/em tags, you'll see that by default they italicize and bold the font. But then you'll come to realize that are the
<i> tags that also perform the same function.
So what's the difference here? Remember that HTML is about semantics, so the
em should be used to emphasize the meaning of some text.
<i> should rarely be used, as styling should be separate from markup.
This book teaches HTML as if it's for anyone - hobbyists, students, and professionals - and it's full-color throughout. It utilizes information graphics and lifestyle photography to explain the topics in a simple way that is engaging. You can progress through the chapters from beginning to end or just dip into topics of particular interest at your leisure.$ Check price
This foam seat cushion relieves lowerback pain, numbness and pressure sores by promoting healthy weight distribution, posture and spine alignment. Furthermore, it reduces pressure on the tailbone and hip bones while sitting. Perfect for sitting on the computer desk for long periods of time.$ Check price