473,387 Members | 3,781 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

HTML Validation.... Is it Imperative?

tharden3
916 512MB
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>").
Sep 4 '08 #1
9 1384
eWish
971 Expert 512MB
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
Sep 4 '08 #2
tharden3
916 512MB
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?
Sep 4 '08 #3
eWish
971 Expert 512MB
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
Sep 4 '08 #4
drhowarddrfine
7,435 Expert 4TB
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.
Sep 4 '08 #5
David Laakso
397 Expert 256MB
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?
Sep 4 '08 #6
tharden3
916 512MB
link
I'm open to suggestions
Sep 4 '08 #7
David Laakso
397 Expert 256MB
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
Sep 4 '08 #8
Dormilich
8,658 Expert Mod 8TB
what about "display: block;" ?
Sep 4 '08 #9
tharden3
916 512MB
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
Sep 4 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Xah Lee | last post by:
in coding Python yesterday, i was quite stung by the fact that lists appened to another list goes by as some so-called "reference". e.g. t=range(5) n=range(3) n='m' t.append(n) n='h'...
2
by: Nick Gilbert | last post by:
Hi I have a number of pages where it is valid for the user to enter HTML. On these pages, I have turned off RequestValidation ("ValidateRequest = false" in the page directive) so that the...
9
by: Alan Silver | last post by:
Hello, I am writing a web form where the user is allowed to enter HTML into one of the textboxes. This of course generates the "potentially dangerous" server error. Now I know I can switch...
12
by: Nalaka | last post by:
Hi, I suddenly started getting a lot of errors from html validation (some CSS) so I followed the following instructions to disable it. If you'd rather not have these types of HTML validation...
2
by: Vinny | last post by:
A customer wants me to convert a VB app I wrote for them into a web app for remote users to do data entry. So, I'm writing a small ASP program which prompts the user for data, much like a VB...
40
by: VK | last post by:
Hi, After the response on my request from W3C I'm still unclear about Tidy vs. Validator discrepansies. That started with <IFRAME> issue, but there is more as I know. Anyway, this very basic...
28
by: Timothy Larson | last post by:
A couple years ago it seemed like XHTML was the direction of most web markup, a foregone conclusion. Now I return to the scene and I see many here recommending that authors stick to HTML, albeit...
8
by: =?Utf-8?B?U2hhd24gUmFtaXJleg==?= | last post by:
I am coming at the world from the standpoint of a veteran ASP Classic developer. I am not clear on the advantages of using the ASP.NET control over standard HTML control. With the ASP.NET...
1
by: Cconfused | last post by:
Hi there, I was wondering if anyone could explain to me the difference between an imperative program, and an OO program? I am fully aware of the languages which support these (older languages...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.