Web Design & Development

[ Web Design & Development Topics ]

Basic (X)HTML Tags

(X)HTML Tags, Elements, and Attributes defined

So in essence tags give attributes to the elements such as type, format, and structure. They are specific text strings used in (X)HTML which are treated as symbols. Lets take a look at a few:

Paragraphs

A paragraph is defined with a <p> tag. If you want to play it safe and get in a good habit you may want to use a closing tag as well even though it is not required. Programming languages such as XML require all tags to have an opening and closing tag. The closing tag is just at the end of the paragraph and looks like </p> or in shorthand it would look like <p/>

Line Breaks

Lets say you want to make a line break-- you just use a <br /> tag. Remember is is good form to use closing tags even if they are not required.. This would look like <br /></br>. or in shorthand it would look like <br />.

Comments

To make a comment in (X)HTML the format below:

<!-- Here is my comment-->

This will not show up in the Web browser, it can just be seen in the source code.

Horizontal Rule

A horizontal rule is simply specified with a <hr> tag. It looks like this by default:


Although you can change the width, length, shading, and alignment. Using Cascading style sheets you can also allter the color and other features.

Here is another sample horizontal rule:


And the source code to go with it:

<hr align="center" width="200" size="10" noshade>

Headers

This is a heading

This is a heading

This is a heading

This is a heading

This is a heading
This is a heading

And the source code to go with it:

<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
<h4>This is a heading</h4>
<h5>This is a heading</h5>
<h6>This is a heading</h6>

Learn more: