Jump to content
Sign in to follow this  
jlundell

w3c validation

Recommended Posts

jlundell

I just installed Whitehouse Pro on a fresh WP installation: http://prleague.org. (It's rough around the edges; I'm in the process of migrating from EE.) w3c html validation fails, apparently on theme-generated code. Give it a try on my front page. w3c css is worse. Most of it is browser-dependent settings, which, well, OK (I wish w3c would have a setting to tolerate those). But there are several real errors buried in the noise. From the comments on the forum, I rather expected all this to validate; I assume that's your intention (browser-specific css aside)?

Share this post


Link to post
Share on other sites
cmunns

I see. Yes, most of that is browser specific CSS, but I'm not sure why they consider this a warning: "Same colors for color and background-color" since this is likely to be the case when styling UNRELATED elements. That seems silly. The HTML validation looks good except for the unclosed tag that might have been injected by EE transfer. We do not have this in the demo, however, the Youtube video on the home page will make demo validation seem poor when in fact it validates perfectly.

Share this post


Link to post
Share on other sites
jlundell

The unclosed tag is being generated by the theme at the end of the secondary menu line. Notice that there appears to be an opening <span> with a closing . Looks like it might be a typo. (I didn't do any kind of automated conversion; I just copied over content.) <li class="page_item page-item-2">About the PR Foundation <li class="page_item page-item-18">Membership Help <li class="page_item page-item-22">Site Map <span class="last"> The other problem is that every time the search widget(?) is used, it employs the same pair of IDs. In my case there's a search at the top and one in the footer. Assuming the IDs are being used (in a script?), this could lead to trouble, or at the very least a noisy validation.

Share this post


Link to post
Share on other sites
jlundell

WRT CSS, there's a syntax error (the 'f' at the end): h1 em, h2 em, h3 em, h4 em, h5 em, h6 em, #nav em{text-transform: lowercase;font-style:italic;f} and an extra argument: #morefootbg { padding-top: 2em 0; When I ran into the same-color problem in another life, I cured it (stopped the noise) with some explicit inherits. Not a big deal, though.

Share this post


Link to post
Share on other sites
bryan-hadaway

Even without the theme, WordPress default doesn't even validate as CSS or XHTML. These errors are not detrimental though. I enjoy having everything valid too, but the only way to validate everything is to manually remove code and edit files manually. This isn't recommended because every time you update/upgrade all those changes will be undone. What I recommend doing is just checking to make sure markup you add yourself validates and you'll be fine. Thanks, Bryan

Share this post


Link to post
Share on other sites
jlundell

I don't mean to be difficult here, but at least some of the (real) errors are coming out of static PageLines files. The ones I mentioned above: themes/whitehousepro/css/theme.css themes/whitehousepro/pro/css/pro.css When I fix the files, the errors disappear (of course). Moreover, my personal blog (same version of WP, same host, theme Paperpunch 1.03) validates just fine: http://validator.w3.org/check?uri=http://pragmatos.net/ ...though the css has some browser-specific lines.

Share this post


Link to post
Share on other sites
bryan-hadaway

What I meant was even WordPress default themes don't validate. If you just make sure to validate code you add yourself your site should be fine and not break. I think the developers are more worried about usability than appeasing W3C, which is a good thing. Thanks for notifying some obvious errors, I still don't recommend validating semantical WordPress errors, in general because you'll run into "errors" with WordPress, a theme, plugins etc. I say "errors" because they're only unknown to W3C, but modern browsers might read them just fine, they're not actual errors messing things up. If you choose to validate everything, you'll have to re-implement those changes every time you upgrade your theme, plugins etc. That's why I advise against it. Thanks, Bryan

Share this post


Link to post
Share on other sites
jlundell

For now, anyway, I'm only asking that the obvious theme-specific errors be corrected. The noisier the theme is (during validation), the harder it is to pick out errors I'm generating. Side issue: below the Reply field I'm typing in right now is another field labelled "Tags". Below that is "(comma seperated)"; should be "(comma separated)".

Share this post


Link to post
Share on other sites
cmunns

Thanks Jonathan, we'll get on these issues.

Share this post


Link to post
Share on other sites
cmunns

Hmmm...I'm checking template files and don't see any of the typos or duplicate styles (except for IE fixes in IE stylesheet) What theme version are you on?

Share this post


Link to post
Share on other sites
jlundell

WhiteHousePro 3.1.0 Here's a sample from theme.css (note the 'f' at the end). h1 em, h2 em, h3 em, h4 em, h5 em, h6 em, #nav em{text-transform: lowercase;font-style:italic;f} I got rid of some of the errors by suppressing the secondary menu line and deleting the second search box. I'm not sure what you're referring to by "duplicate styles". Perhaps it's the duplicate id's caused by having more than one search box. Another point: XHTML has no 'role' attribute; you should probably be using 'class' here. (Example of error: try w3c validation of http://prfound.org)

Share this post


Link to post
Share on other sites
cmunns

the role attribute was something that wordpress implemented but does not validate with XHTML 1.0 (it can be safely deleted) Also, I checked for the typy of the "f" at the end of that CSS rule but did not see it in the template files. The typo has got to be on your side...I saw that you did duplicate the style somewhere (FireBug is showing me a prfound.org style with the same selector )

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×