HTML tag, element, and attribute formatting

Elements vs. tags

An element includes the tags, the attributes, and the content, if any. For example, consider the following:

<h1 align=“center”>This is a heading</h1>

In this example, the H1 element consists of the start tag (<h1>), including the align attribute, the “center” value of the align attribute, the content (“This is a heading”), and the end tag (</h1>).

Some elements, such as META and IMG (image), do not have start and end tags; they only have a single tag with attributes.

Formatting guidelines

  • Use all uppercase for element names, and surround the element name with the definite article the and element. Examples are the H1 element and the FONT element.

  • Use angle brackets and lowercase for tags. Examples are the <h1> tag and the <font> tag.

  • Use bold formatting and lowercase for attributes and their values. An example is the “center” value of the align attribute.

Microsoft style

The FONT element includes start and end tags, attributes, and any content within the tags. The start <font> tag begins the FONT element, and the end </font> tag ends the FONT element. In the FONT element, you can use attributes such as face, size, and color.

Note

HTML is not case-sensitive.

For more information, see Document conventions; XML tag, element, and attribute formatting

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.173.53