Home >> FAQs/Tutorials >> XHTML Tutorials and Tips >> Index

XHTML 1.0 Tutorials - Understanding In-line Elements and Tags

By: FYICenter.com

Part:   1   2  3  4 

A collection of 11 FAQs/tutorials tips on XHTML inline elements and tags. Clear answers are provided with tutorial exercises on inline elements like: strong, em, code, sub, sup, del, ins, big, small, br, script. Topics included in this collection are:

  1. What Are Inline Elements?
  2. What Are Commonly Used Inline Elements?
  3. What Is a STRONG Tag/Element?
  4. What Is an EM Tag/Element?
  5. What Is an CODE Tag/Element?
  6. What Are SUB and SUP Tags/Elements?
  7. What Are DEL and INS Tags/Elements?
  8. What Are BIG and SMALL Tags/Elements?
  9. What Is a BR Tag/Element?
  10. What Is a SCRIPT Tag/Element?
  11. What Are Other Inline Elements?

Please note that all notes and tutorials are based on XHTML 1.0 specification.

What Are Inline Elements?

Inline elements are XHTML elements that can be used together with character data to form lines of paragraph blocks. Here are some basic rules about inline elements:

  • Inline elements are usually used as sub-elements of block elements.
  • Some inline elements have empty contents.
  • Some inline elements have mixed contents with text and other inline elements.
  • Some inline elements are used to specify style properties which could be achieved by CSS technologies.

What Are Commonly Used Inline Elements?

Here are some commonly used inline elements:

  • strong - Defining text with a strong emphasis.
  • em - Defining text with an emphasis.
  • code - Defining computer code text.
  • sub - Defining a subscript text.
  • sup - Defining a superscript text.
  • del - Defining text to be treated as deleted text.
  • ins - Defining text to be treated as inserted text.
  • b - Defining the bold font weight to its content.
  • i - Defining the italic font style to its content.
  • tt - Defining a teletype font to its content.
  • big - Defining a bigger font size to its content.
  • small - Defining a smaller font size to its content.
  • br - Defining a line break.
  • script - Defining client-side script code.
  • a - Defining an anchor.
  • img - Defining an image.
  • map - Defining a clickable image map.
  • input - Defining an input field in a form.
  • select - Defining a selection field in a form.
  • textarea - Defining an input text area in a form.
  • label - Defining an input field label in a form.
  • button - Defining an action button in a form.
  • span - Defining a logical group of inline elements and text.

What Is a STRONG Tag/Element?

A "strong" element is an inline element that you can use to specify text with a strong emphasis. Here are basic rules about "strong" elements:

  • "strong" elements are inline elements.
  • "strong" elements can not be used at block level.
  • Contents of "strong" elements will be displayed in bold by most browsers.
  • "strong" elements will be treated like "b" elements by most browsers.
  • "b" elements may not be supported in future versions of XHTML, You should not use "b" elements in your XHTML.

Here is a good example of "strong" and "b" elements:

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
 <head>
  <title>STRONG and B Elements</title>
 </head>
 <body>
  <p>The <strong>Rich</strong> must live more simply
  so that the <b>Poor</b> may simply live.</p> 
 </body>
</html>

If you save the above document as strong_and_b.html, and view it with Internet Explorer, you will see that contents in both "strong" and "b" are displayed in bold as shown below:
            strong Tag

(Continued on next part...)

Part:   1   2  3  4 


Selected Developer Jobs:

More...