If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

XHTML 1.0 Strict Validation error, I don't understand

I attached a screenshot for simplicity.
This screenshot is less compressed than the attachment: here:

I'm not sure what this error is telling me. This code was taken right from the HTML, XHTML & CSS sixth edition Elizabeth Castro book. Although she used Transitional, which works across Firefox, IE, Chrome. However, when I use Strict, it works fine in Firefox, and Chrome, but IE 8 ignores the styles. However, I think the last issue is more related to IE being thrown into corks mode. So I would naturally use transitional for this.

I passed the validation by adding P tags around the links. But I don't understand why they were needed.
I think links are inline elements, and I know you can't add block level elements to inline, but that was not the case.
There was nothing else on the page, just the links themselves. So why do they need to be enclosed in some type of block level element? Is that the rule for XHTML strict 1.0?

Thank you Jeff for the direct and precise explanation.
I should probably put some time into reading the specs. I was kind of hesitant on reading any WC3's explanations at this point. I find many technical spec documentation difficult to understand because of how they word things. (same difficult situation with reading Linux Man pages when you're new..lol) But you're explanation was priceless and very clear. Thank you!

At the moment I've just been working out of a book, and watching videos here-and-there. What I find odd is, the book I'm using recommends only writing clean strict code, yet "all" the doc types through out the book use transitional. It is a great book, but I was surprised it didn't mention this. and I've been scanning the chapters front to back.

Another fix that would work is to set the hyperlinks themselves to be block elements in the CSS:

a { display: block; }

This way your XHTML markup remains the same as before, and is less cluttered, and you just have a little extra CSS. Saves a little bandwidth.

Personally I find some of the rules for 'strict' to be a bit arbitrary to be honest. I've often encountered similar validation errors and much as I can normally figure out what rules I'm breaking, I don't really understand the justification for having those rules anyway. They seem to be driven more by some kind of dogma than by practical considerations. I tend to stick to transitional these days rather than strict as life is too short to waste on arbitrary formatting issues just to keep the w3c validator happy.

Good tip, Thank you Flack
I do recall recently reading about changing an element with display, but didn't understand the books explanation for what it was used for.
However, it makes perfect sense in the context you mentioned. Good to know.

I know how you feel with regard to complying with strict. I notice most pages still use transitional which Is fine I guess for most pages. On the other hand, according to my book titled: Xhtml css 6 Elizabeth Castro, it says in order to take advantages of things like databases, you have to use strict. SQL databases is really the reason for me learning PHP. Though I have seen pages with database's and forms using Transitional, I don't really know what limitations one would run into by not using strict, so I figured I would just take the long way and learn it. But somethings do seem redundant. I have much to learn still.

You don't need to use XHTML strict or any other particular flavour of HTML to use databases, it has no bearing or effect on how a site integrates with a database. It may have an effect on how the data you pull from a database displays, but that is true of any data on a page whether it came from a database or not. As long as your HTML can be parsed by a browser so it can see what form fields you're passing, then it really doesn't matter what HTML format you use. The form handler receives the same input, and the database process happens the same as it would whether your page is displaying in XHTML strict, transitional or quirks mode even.

The most important thing if you're getting into databases is to read up on SQL injection and how to avoid it, i.e. parametrized queries and stored procedures. This is what you need to know before you start working with online databases, regardless of what scripting platform or database you're using. You don't want your first knowledge of SQL injection to be after your first site gets hacked!

Thanks again Flack.
I've actually put SQL off to the side for the moment to focus on CSS and PHP. But that's good to know. After you mentioned that the other night, I ran though the security section of my SQL books and they have whole sections dedicated to injections. I'm just not there yet. But security is going to be a major concern at some point. I'll keep this in the back of my head.

By the way,
At the moment, I'm keeping templates with comments of all the things I'm learning. However, although I have memorized a lot with regard to syntax rules, ..and even structuring things like basic css selectors, I often have to keep going back to reference my notes on certain property names, or sometimes I'll forget how to structure something. I sometimes wonder if I have a bad memory or if it's just that I'm still new to this. I spend a lot of time studying the rules. I guess at this point, I need to just make up projects for myself and it will sink in. Like the doc type for example, I just copy and paste that. If I don't make myself memorize it, I'll never remember it.