Tags and Attributes
We looked earlier at how tags tell browsers what to do with text, as in
<b>This text is bold</b>
which made the enclosed text bold.
Quite often though there is a lot more than a simple instruction such as this
contained in the opening tag.
Lets have a look at the <a> tag as an example.
Anything surrounded by <a> and </a> is a hyper link. Except it
isn't that simple. The opening <a> tag on it's own is meaningless and
will be ignored by browsers. Thus
<a>A link</a>
Will appear as simple text since when a browser encounters a meaningless tag
it simply ignores it. In fact this is what it will look like: "A link".
Nothing special there.
However using
<a href="http://www.frontpage-web-hosting.com">A link<a>
gives us: "A link"
Now we have lift off. Clicking on that will take you to the frontpage-web-hosting
home page.
The important bit is
href="http://www.frontpage-web-hosting.com
and information like this within the opening tag is referred to as an 'attribute'.
The attribute itself is divided into two parts, the attribute name
(href) and the attribute value (http://www.frontpage-web-hosting.com)
Attributes elaborate on the basic tags and while some tags require them in
order to work, others don't but can be refined in their function by the addition
of attributes.
Of course you can bypass all of this by adding hyperlinks quickly using FrontPage
and that is the sensible way to proceed. However it is important to be aware
of attributes as quite often they are the parts of your HTML that may cause
problems with browser compatibility.
Adding Your Own Meta Tags to Pages
We will look at adding a few keywords to the document to help search engines
index our page.
1. On the File menu, click Properties, and
then click the Custom tab.
2. Under User Variables, click Add.
3. In the Name box, type 'keywords'.
4. In the Value box, type the keywords for your page, using
commas to separate words.
5. Click OK
The new meta tag will automatically be added to your page. You can repeat this
procedure to add a 'description' meta tag.
In the case of this page the following tags were generated and added to the
<head></head> section of the page:
<meta http-equiv="description" content="A
basic introduction to HTML for FrontPage users">
<meta http-equiv="keywords" content="HTML, FrontPage, beginner,
introduction">
If you later want to add more keywords it is often easier to just go into HTML
view and type them right in there.
Some times you will see these meta tags written as
<meta name="description" content="A
basic introduction to HTML for FrontPage users">
<meta name="keywords" content="HTML, FrontPage, beginner,
introduction">
There is essentially no difference between the two forms.
Part III >>