...

View Full Version : Show me the way to go Home!



effpeetee
05-17-2007, 09:45 AM
In the light of the Validator's remarks below, how should I code the return to my index page?

effpeetee

The "a" element is not allowed here. In a strict XHTML 1.0 document, the "a" element must be contained in an appropriate container, like a block or inline element. Examples of block elements are "p", "h1", "h2", "div", "ol", "ul", and "table". Examples of inline elements are "a", "b", "i", "strong", "em", and "span".


<body>
<a href="index.html">Home.</a><br />
<table align="center" cellspacing="10" cellpadding="15">

NancyJ
05-17-2007, 11:06 AM
Just like the validator says - it has to be in a block level element eg.



<body>
<p><a href="index.html">Home.</a></p>
<table align="center" cellspacing="10" cellpadding="15">


Though you might want to look into semantic coding - validation alone is worthless - it doesnt mean your site is good or well coded.

effpeetee
05-17-2007, 11:18 AM
Just like the validator says - it has to be in a block level element eg.



<body>
<p><a href="index.html">Home.</a></p>
<table align="center" cellspacing="10" cellpadding="15">


Though you might want to look into semantic coding - validation alone is worthless - it doesnt mean your site is good or well coded.
Thank you.

<h5><a href="index.html">Home page.</a></h5> - This doesn't work

a href="index.html"><h5><Home page.</a></h5> - This does.

http://www.exitfegs.co.uk/hol1.html


VIPStephan has already suggested that I look into semantic coding. At present, I am an 82 year old trying to come to terms with XHTML and CSS.

My site has been largely cobbled together - often cribbed from the Web.

It works. But I am going to get it sorted out before I go to that great coding house in the sky!!

I am not sure where semantics take precedence over validation though.

effpeetee

Many thanks to you all for your help. Already the main pages are getting better, and I am being to see the trees in the forest.

VIPStephan
05-17-2007, 12:15 PM
<h5><a href="index.html">Home page.</a></h5> - This doesn't work

a href="index.html"><h5><Home page.</a></h5> - This does.

Nah, this canít be rightÖ
Semantic code means you choose elements after their meaning and you structure your markup logically. A clean structure would be to divide your page into different sections: header, content, footer (optional), using division elements - and all those three main sections are wrapped by a big container. Like that:



<div id="container">
<div id="header"></div>
<div id="content"></div>
<div id="footer"></div>
</div>


If your have a big wrapper/container element that means you can't get such errors as the one you posted above because every element you put inside that container is already within a block level element (the container div).
So, putting a general wrapper/container div around your content (inside the body) will make this error go away already for a first step.

Next: Again, this link isnít a headline, is it? And if it is it canít be a h4 just by itself because according to the document structure you would need h1 through h3 before you can put an h4 element.
Choosing an element by the look it generates, e.g. choosing a headline element just because it makes text look bold is the least semantic and the worst approach.

Donít get confused by the way something looks because you can always change the look with CSS. You could even make a <strong> element (which makes text look bold too) look thin and oblique with CSS but the function it has would stay the same, i.e. a screen reader would still accentuate that text (speak it louder, with more emphasis).

A short rule of thumb is: Structure your document logically and choose elements, and class and ID names after their function, not their intended look. The look can always be changed with CSS.

effpeetee
05-17-2007, 01:25 PM
Nah, this canít be rightÖ
Semantic code means you choose elements after their meaning and you structure your markup logically. A clean structure would be to divide your page into different sections: header, content, footer (optional), using division elements - and all those three main sections are wrapped by a big container. Like that:



<div id="container">
<div id="header"></div>
<div id="content"></div>
<div id="footer"></div>
</div>


If your have a big wrapper/container element that means you can't get such errors as the one you posted above because every element you put inside that container is already within a block level element (the container div).
So, putting a general wrapper/container div around your content (inside the body) will make this error go away already for a first step.

Next: Again, this link isnít a headline, is it? And if it is it canít be a h4 just by itself because according to the document structure you would need h1 through h3 before you can put an h4 element.
Choosing an element by the look it generates, e.g. choosing a headline element just because it makes text look bold is the least semantic and the worst approach.

Donít get confused by the way something looks because you can always change the look with CSS. You could even make a <strong> element (which makes text look bold too) look thin and oblique with CSS but the function it has would stay the same, i.e. a screen reader would still accentuate that text (speak it louder, with more emphasis).

A short rule of thumb is: Structure your document logically and choose elements, and class and ID names after their function, not their intended look. The look can always be changed with CSS.
Hello VIPStephan,
Firstly, I have added the code that you sent me, to "include.js" .
IE7 and Opera like it but Firefox does not. It is up on my site now,

www.exitfegs.co.uk

Thank you for your help above. I can see what you mean.

The trouble is that I have learned HTML from the top downwards instead of from the bottom upwards, and I am paying the price for my bad choice.

However, I am trying to put matters right and I thank you all for your patience. It is a steep climb but quite enjoyable. I just hope that I do not become a bore.

effpeetee

You can see me here!! http://www.exitfegs.co.uk/dadatpub.html



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum