This is some text and <strong>this part is within strong tag</strong> this part is normal
Output is here
This is some text and this part is within strong tag this part is normal
<html>
<head>
<title>(Type a title for your page here)</title>
<style>.strong1 {
background-color: yellow;
}</style>
</head>
<body>
<p>This is some text and <strong class=strong1>this part is within strong tag</strong> this part is normal
</body>
</html>
This is some text and this part is within strong tag this part is normal
This is some text and <em>this part is emphasized</em> this part is normal
Output is here
This is some text and this part is emphasized this part is normal
Adding style to <em> tag
By using style we can add underline to our emphasized text inside <em> tag
<html>
<head>
<title>(Type a title for your page here)</title>
<style>
em {
text-decoration: underline;
}
</style>
</head>
<body>
<p> Plus2net.com is a site for <em>web programming</em> and learning SEO</p>
</body>
</html>
Plus2net.com is a site for web programming and learning SEO
The <strong> and <em> tags are pivotal in conveying meaning beyond mere styling:
Nesting <em> within <strong> to convey both importance and emphasis:
<p>It is crucial to never ignore safety protocols.</p>
In this example, the word "never" is both emphasized and highlighted as crucial.
Applying custom styles to <strong> and <em> tags using CSS:
<html>
<head>
<style>
strong {
color: red;
}
em {
text-decoration: underline;
}
</style>
</head>
<body>
<p>This is a <strong>very important</strong> message with an <em>emphasized</em> word.</p>
</body>
</html>
Here, the <strong> tag is styled to display red text, and the <em> tag adds an underline to the emphasized word.
Using <strong> and <em> to improve content accessibility:
<p>Please <strong>read</strong> the terms and conditions <em>carefully</em> before proceeding.</p>
This usage ensures that assistive technologies can convey the importance and emphasis appropriately.
By understanding and implementing the semantic roles of the <strong> and <em> tags, we can create more meaningful, accessible, and SEO-friendly web content.
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.