WengerEnterprises
    Simplifying Web Design


Pages

Tools

Webmasters

Follow Me on Twitter!


    

Special HTML Tags



In this lesson you will learn special HTML tags like line breaks and horizontal lines. They are useful tools to use to enhance the layout of any site. The line break is the most used; however, the horizontal line is also fairly important.

Line Breaks

First we will start with the line break. This is one of the easiest tags that you will use, and also one of the most helpful. It pretty much is like pressing enter on a web page. As you know, pressing enter once makes a new line, while pressing enter twice double spaces it.

<br /> is a line break.

<p>HI<br />HI again</p>

<p>HI<br /><br />Double Spaced</p>

HI
HI again

HI

Double Spaced

Simple isn't it? This tag has only one attribute, the clear="all" attribute. This is used to make a new line below all current objects. You will learn more about this in CSS.

Horizontal Lines



The gray line above is a horizontal line. The code for the horizontal line is almost as easy as the code for a line break. There are some attributes, but they are simple to use.

<hr />



That was really easy wasn't it? There are a few attributes with this tag, and they're really simple. They are the width, size, and color attributes. Size is equivalent to height in images.

<hr size="10" width="300" color="blue" />



Ah, we have come upon our first browser conflict. As you most likely know, a browser is what allows you to access the internet. It interprets the code that comes from your site and turns it into what you can see. Most likely, you are using Internet Explorer. What you might not know is that there are many different browsers. Examples of these are FireFox, Opera, Netscape, and of course, Internet Explorer. I check my site in all of these to make sure it works properly in each one.

Since browsers are created by different companies, they are made up of different code. Every once in a while, there will be some tags and attributes that one browser or another won't use. The horizontal line's color attribute is one of them. In just about any browser but Internet Explorer, the line will be gray instead of any other color.

Now, you've probably been wondering why the tag for the horizontal line is "hr". The technical term for it is "horizontal rule". It may be confusing at first, but the more you type HTML and other coding languages, the easier it is to type the tag correctly without even thinking about it. For instance, I have gotten into the habit of typing greater than ( > ) and less than ( < ) symbols with the right shift, instead of with the technically correct left shift. The reason for this is that it is much closer to them, so making your tags is quicker.

That was a lot of explanation for two simple little tags. The next lesson is on lists.



©WengerEnterprises.com - All Rights Reserved

Privacy Policy