Skip navigation.

Strong, Italic and Underline - Your Fourth Web Page

How to write text in bold, italic and underline in XHTML documents?

We have created three web pages and now we know how to write text paragraphs in XHTML documents. We also learned how to include line breaks and non-breaking space characters in XHTML documents. In this primer we will learn how to write text in bold, italics and underline in XHTML documents.

<strong>...</strong>
The strong tag begins with <strong> and ends with </b>. Any text inserted within the <strong> and </strong> is displayed in bold. The strength of the text enclosed in <strong> and </strong> is notably greater, hence the name of the tag is strong. <b>...</b is also an XHTML. The <strong>...</strong> tag has the same effect as <b>...</b>. The usage of strong tag is more appropriate than the bold tag.

<i>...</i>
The italic tag begins with <i> and ends with </i>. Any text inserted within the <i> and </i> is displayed in italics.

<u>...</u>
The underline tag begins with <u> and ends with </u>. Any text inserted within the <u> and </u> is underlined.

The bold, italic and underlie tags are very useful to differentiate text content in XHTML documents.

Let's write a sample web page and demonstrate the use of bold, italic and underline tags.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta name="generator" content="HTML Tidy for Linux (vers 1 September 2005), see www.w3.org" />
<title>Bold, Italic and Underline - Your Fourth Webpage</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<p>In this document we are learning three new elements - bold, italic and underline.</p>
<p>Let us write some text in bold. Here <strong>we go</strong>. Let us write some text in italic also. Here <em>we go</em>. Now is the time to underline some text. <u>These words</u> are underlined.</p>
</body>
</html>

I guess the tags are self explanatory. If you want to me describe them please let me know by posting comments here. I will be glad to clarify your questions. The example files are attached. You can download them for your reference.



AttachmentSize
strong-italic-underline-your-fourth-webpage.html1.09 KB
strong-italic-underline-your-fourth-webpage.pdf18.36 KB

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Use the special tag [adsense:format:group:channel] or [adsense:block:location] to display Google AdSense ads.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.