Now that we know the basic way to display text in html page,
for instance:
<body>
<p>I love web dev!</p>
</body>
You can emphasize the text by wrapping it with <em>
tag like so:
<p>I love <em>web dev</em> !</p>
By default, your emphasized word will be italic like so:
I love web dev !
Tips: shift
+ cmd
+ p
to open Command Palette, type wrap
, and enter the name of the tag (e.g. em
) to wrap selected text with tags.
Yet you can customize your own <em>
tag in styling section.
<style>
em {
color: red;
font-style: normal;
}
</style>
Note: As your code getting larger, you should always keep your html having TEXT ONLY and move all your styling to your CSS file.
Creating different levels of heading by simply making <h#>
tag.
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
Note: You should ALWAYS use heading based on their hierarchy instead of their size since the size can be changed in CSS.