argghh! html/xhtml validation

taff's picture

They have: 956 posts

Joined: Jun 2001

Ok, I'm a little late to the dance here but I decided that it was time to get off my duff and get some of my coding skills up to date.

I was able to bring up a couple of sites to xhtml 1.0 transitional with one exception: I have no idea how to get around the limitation of not being able to use table heights (ie 100% for page centering).

So with this one error remaining, I need to revert back to the html4 doctype for proper viewing of the site. Of course, now the validator chokes on all the xhtml-related "errors".

Is it wise to even use a doctype if I can't get it fully compliant one way or the other?

.....

disaster-master's picture

She has: 2,154 posts

Joined: May 2001

I am not exactly sure what you are talking about without seeing it but see if this is what you need.

disaster-master's picture

She has: 2,154 posts

Joined: May 2001

Here is one on vvertical centering.

taff's picture

They have: 956 posts

Joined: Jun 2001

hey, that vertical one looks promising.

What I'm working on isn't online but basically I'm looking to achieve an xhtml-friendly alternative to a full-height table - I use them a lot to page center splash pages, etc.

If I don't but do use xhtml throughout the rest of the document, I'm not compliant with either and my initial question stands - Is it wise to use an html4 doctype with xhtml tags? Everything renders ok but chokes the validator. Should I not use a doctype at all?

.....

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

What I've been doing with xhtml strict is just allowing a few errors (like target="" which isn't in the spec for example fails the validator). I'm sure purists would say this ia bad way to go, but personally I don't have a problem with a few errors (for good reason, of course).

taff's picture

They have: 956 posts

Joined: Jun 2001

grr, lost my response. Here we go again..

with doctype xhtml 1.0 transitional, I've got the one error - table height 100%. I could live with that if the browsers would. Every browser I tested in simply ignores the height attribute and the page is a mess.

with doctype html 4.01 transitional, everything views fine.. so far but now by validation standards I've got dozens of errors (each xhtml-specific tag). My thought is that no doctype is the way to go here but wanted to get some thought on that.

The site is actually up now but I'm still waiting for the dns transfer to kick in. When it does, I'll post a link.

.....

disaster-master's picture

She has: 2,154 posts

Joined: May 2001

Do you have to use a table?

I am wondering, can you use a div with a table inside and set the div to have margins of 0px; ??

taff's picture

They have: 956 posts

Joined: Jun 2001

Quote: Originally posted by disaster-master
Do you have to use a table?

Not if I can find a broad reaching alternative but I'm just on the learning curve of that now.

Maybe its the heat but I guess I just not asking this right. My real question in all this rambling is the doctype one.

.....

disaster-master's picture

She has: 2,154 posts

Joined: May 2001

Quote: Is it wise to even use a doctype if I can't get it fully compliant one way or the other?

I am sure you have already seen this but it says "Using an incomplete or outdated DOCTYPE—or no DOCTYPE at all—throws these same browsers into “Quirks” mode, where the browser assumes you’ve written old-fashioned, invalid markup and code per the depressing industry norms of the late 1990s."

If it validates using the html doctype, use that. Nothing wrong with switching doctypes from page to page. If it still won't validate using the html doctype, I would still put the doctype on the page.

Ok...I am going away. It's hot. Wink

They have: 93 posts

Joined: Jun 2003

If all else fails...CHEAT.

Often you can cheat sizing with a 1x1 transparent gif (commonly used by Adobe's ImageReady called spacer.gif)

By setting this images height and width the table MUST size to the image. You can use % on images so that might let you cheat your way to a solution when you need one in a jam.

[Design Alpha] -Web Services : Design,Hosting,Advertising,Software
Ask about custom pricing on hosting!!
Site Assets: [UltraGaming.com] [Blades of Warcraft]

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Oh, but such an outdated, cheap solution. Not a good way to go, IMO. Did you dry the div's with margins? Or give us a URL and we'll figure something out. Once you learn more about xhtml you'll know how to design layouts that work from the start Smiling

taff's picture

They have: 956 posts

Joined: Jun 2001

This was more of an idle conversion attempt rather than xhtml from scratch. The domain is active for me now so you may or may not see it yet. The two noncompliant issues are the splash page (full-width, full height table) and the nav sidebar on the sub pages.

The current doctype is html4.01 transitional which returns dozens of errors on validation but everything appears to render fine whereas with the xhtml doctype, I get one error but it's a doozy - layout falls apart.

frogcatcherfilms.com

.....

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Sorry. I didn't mean to insinuate that you should start from scratch. I just meant for next time you'll know....

taff's picture

They have: 956 posts

Joined: Jun 2001

Quote: Originally posted by Megan
Sorry. I didn't mean to insinuate that you should start from scratch. I just meant for next time you'll know....

heh - no problem. I realize that these things are best tackled from scratch but I had some down time and this project was pretty simple so I decided to give it a go.

I also converted my own site (not uploaded atm) but ran into the same headache of page centering the splash page. Ah! This is all a conspiracy to get me to stop using splash pages, ain't it! Wink

I took a look at the links d-m posted on vertical centering with css but have yet to get my brain around it.

.....

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

No, you just have to find a different way of positioning them. Where is Suzanne when we need her, eh?

disaster-master's picture

She has: 2,154 posts

Joined: May 2001

Quote: Where is Suzanne when we need her, eh?

Oh, you can bet she is lurking and laughing her behind off at us trying to figure out something that is probably so simple.Roll eyes Laughing out loud

This is how you get Suzanne.

Hey Suzanne! Where are you!!
She can hear the large bold font. Wink

taff's picture

They have: 956 posts

Joined: Jun 2001

Quote: Originally posted by disaster-master
She can hear the large bold font. Wink

Especially in sans serif Laughing out loud

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.