Prev

Inline Styles

Remember: Block-level tags add a line break before and after the tag. Inline styles affect how text appears without adding breaks or extra spaces.
Most of the tags you've learned so far have been block-level elements. This means they cause a line break before and after the tag, such as the <h1> tag or the <p> tag. Another kind of tag is an inline-level element, which changes how text appears without adding line breaks. The next sections describe two of these types of tags.

The <em> tag

Try It: Use inline styles, such as <em> and <strong>.

Inline Styles
We <em>really</em> <strong>really</strong>
hope you are enjoying this lesson!
will appear as:
We really really hope you are enjoying this lesson!
The "em" in <em> stands for emphasis and indicates the text inside this container tag should be emphasized, or stressed, a lot like when you put an exclamation point after a sentence. For example, in this sentence, the word sentence is emphasized. Most browsers indicate emphasis by italicizing the text.

The <strong> tag

The <strong> tag is just like the <em> tag only even more so. So if you really want to strongly emphasize something, you would use the <strong> tag. Most browsers indicate strong emphasis by bolding the text.

Prev