 |

September 4th, 2008, 02:23 AM
|
 |
Site Addict
|
|
Join Date: Jul 2008
Location: Ocala, FL (USA)
Age: 17
Posts: 590
|
|
HTML Validation.... Is it Imperative?
My site is HTML Valid by the W3C for all but one error. You see, to make a really great navigation bar in my left column, I added the <p> attribute to the text in-between an <a href=""></a> link attribute. I did this so that I would have better control over the text. The trick works, and it looks and functions great in every browser, but does not pass Validation standards. Your not supposed to have <p>, a block-line attribute, inside of
<a href=""></a>, an in-line attribute. It's not hurting anyone, and like I said, it works and looks fine. Do I absolutely need validation?
P.S. If you didn't get what I was talking about...
What I did looks like this:
[HTML]<a href="http://www.htmldog.com"><p>Games</p></a>[/HTML]
And the W3C said I was being naughty:
Line 23, Column 66: document type does not allow element "p" here; missing one of "object", "ins", "del", "map", "button" start-tag.
…links" id="dos"><a href="http://www.htmldog.com"><p>Games</p></a></li>
✉
The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.
One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
|

September 4th, 2008, 02:38 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Arkansas
Posts: 815
|
|
Validation is very imperative. It is a must have tool when designing websites that you would like to render correctly. As for the error you have posted simply remove the <p> and </p> around the Link Name.
When you use the <p> tag's you are telling the browser that you are going to have a paragraph. A single word in my opinion should not be considered a paragraph. I guess that I missed the trick that you are wanting to achieve with the use of the paragraph tag.
--Kevin
|

September 4th, 2008, 02:50 AM
|
 |
Site Addict
|
|
Join Date: Jul 2008
Location: Ocala, FL (USA)
Age: 17
Posts: 590
|
|
Quote:
|
Originally Posted by eWish
Validation is very imperative. It is a must have tool when designing websites that you would like to render correctly. As for the error you have posted simply remove the <p> and </p> around the Link Name.
When you use the <p> tag's you are telling the browser that you are going to have a paragraph. A single word in my opinion should not be considered a paragraph. I guess that I missed the trick that you are wanting to achieve with the use of the paragraph tag.
--Kevin
|
Yes, but why. If everything is working correctly in every browser, and everyone else on the planet is ok with it besides the W3C, then it's ok right?
|

September 4th, 2008, 03:20 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Arkansas
Posts: 815
|
|
I am not certain about the specifics and only know what I have read. Doing some things (this being one of them) is not considered good structure. I hope that either Doc, David or any other expert will have a better answer for you.
--Kevin
|

September 4th, 2008, 03:41 AM
|
 |
Expert
|
|
Join Date: Sep 2006
Posts: 4,586
|
|
1) There is no guarantee that all browsers will handle the same error the same way.
2) It works today but there is no guarantee it will work when the next version of any browser comes out.
3) This error disrupts the layout in the DOM. If you were to ever use javascript to do any manipulation, you may not be able to follow the structure properly to get to that or other elements.
4) You are relying on an error to make your page work. You do not need to apply one error to make another error work.
|

September 4th, 2008, 11:37 AM
|
 |
Expert
|
|
Join Date: Aug 2008
Location: US
Posts: 302
|
|
Provide a clickable link to the page. Perhaps someone on the forum can offer a different menu construct that is valid and will look and work as well if not better than what you got?
|

September 4th, 2008, 12:01 PM
|
 |
Site Addict
|
|
Join Date: Jul 2008
Location: Ocala, FL (USA)
Age: 17
Posts: 590
|
|
link
I'm open to suggestions
|

September 4th, 2008, 12:52 PM
|
 |
Expert
|
|
Join Date: Aug 2008
Location: US
Posts: 302
|
|
Quote:
|
Originally Posted by tharden3
link
I'm open to suggestions
|
A suggestion for a place to start was given yesterday. See at bottom of your thread/post: screen resolution-- #8
|

September 4th, 2008, 02:41 PM
|
 |
Expert
|
|
Join Date: Aug 2008
Location: Leipzig, Germany
Age: 31
Posts: 599
|
|
what about "display: block;" ?
|

September 4th, 2008, 09:12 PM
|
 |
Site Addict
|
|
Join Date: Jul 2008
Location: Ocala, FL (USA)
Age: 17
Posts: 590
|
|
Quote:
|
Originally Posted by David Laakso
A suggestion for a place to start was given yesterday. See at bottom of your thread/post: screen resolution-- #8
|
ahh, true true. Thanks for the help
|
 |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over network members.
|