kubrick, validation of HTML and CSS
Hi!
I tried to validate my website today at http://validator.w3.org/ but i got the errors you see below. "kubrick" is the theme i use on Drupal 5.x and i have posted 1 post on the website. I think the errors is related to the posts, cause when i had no posts and the message you get when you have no posts on the main page is there i only got about 1 error if i remember correct. If you need access to the website itself, try validate this website: http://kubrick.theme.drupaler.net/ it get about the same errors as me i guess.. I hope someone out there know how to fix the errors.
It also seems like the CSS isn't quite done yet to be compatible with browsers like Firefox and Internet Explorer at the same time. Well ok it was nothing big actually, just that the listing icons to the menu disappeared if another window came on top of it (if I opened a window to browse "My computer" or anything else). BTW if you have the problem i have with the menu it's many ways to fix it. One easy way is to add a little margin (maybe 5?) in the CSS code to the menu. I found more ways to fix it but that was one of the ways, and yes there is more than one place you can add a small margin to fix it (use the Web Developer Toolbar for Firefox to see wich code in the difrent CSS files that is used for the area you want to edit). However, the CSS validated so i don't have any questions about it.
Here is the HTML validation errors including the source it put out:
Validation Output: 5 Errors
1. Error Line 34, Column 31: end tag for "p" omitted, but OMITTAG NO was specified.
<p class="postmetadata"></div>
You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
2. Info Line 34, Column 2: start tag was here.
<p class="postmetadata"></div>
3. Error Line 34, Column 32: XML Parsing Error: Opening and ending tag mismatch: p line 34 and div.
<p class="postmetadata"></div>
4. Error Line 68, Column 7: XML Parsing Error: Opening and ending tag mismatch: div line 18 and body.
</body>
5. Error Line 69, Column 7: XML Parsing Error: Opening and ending tag mismatch: body line 17 and html.
</html>
6. Error Line 69, Column 7: XML Parsing Error: Premature end of data in tag html line 2.
</html>
Below is the source input I used for this validation:
1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2. <html xmlns="http://www.w3.org/1999/xhtml" lang="nb" xml:lang="nb">
3. <head>
4. <title>Test</title>
5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6. <link rel="alternate" type="application/rss+xml" title="Test RSS" href="http://someIPadress/test/?q=rss.xml" />
7.
8. <link rel="shortcut icon" href="/test/misc/favicon.ico" type="image/x-icon" />
9. <style type="text/css" media="all">@import "/test/modules/node/node.css";</style>
10. <style type="text/css" media="all">@import "/test/modules/system/defaults.css";</style>
11. <style type="text/css" media="all">@import "/test/modules/system/system.css";</style>
12. <style type="text/css" media="all">@import "/test/modules/user/user.css";</style>
13. <style type="text/css" media="all">@import "/test/themes/kubrick/style.css";</style>
14. <script type="text/javascript"> </script>
15. </head>
16.
17. <body>
18. <div id="page">
19. <div id="header">
20. <div id="headerimg">
21. <h1><a href="/test/" title="Hjem">Test</a></h1> </div>
22. <ul id="primarylink"><li><a href="/test/?q=node/3">Link1</a></li><li><a href="/test/?q=node/1">Link2</a></li></ul> </div>
23. <hr />
24. <div id="content" class="narrowcolumn">
25. <div class="navigation"> </div>
26. <div id="message"></div>
27. <h2 class="page-title"></h2>
28. <!-- start main content -->
29. <div class="node">
30. <h2><a href="/test/?q=node/23">Tittelen til en nyhet på forsiden</a></h2> <div style="float:left;"> </div>
31. <small>Skrevet av admin, 31 desember, 2007 - 07:20</small>
32. <div class="entry"><p>Innhold til en nyhet på forsiden.</p>
33. </div>
34. <p class="postmetadata"></div>
35. <!-- end main content -->
36. </div>
37.
38. <div id="sidebar">
39. <br />
40. <div class="block block-block" id="block-block-1">
41. <h2></h2>
42. <div class="content"><h2>Overskrift:</h2>
43. <p><a href="mailto:noreply@domain.com">Navn</a><br />
44. Tlf: 00 00 00 00</p>
45. <p><a href="mailto:noreply@domain.com">Navn</a><br />
46. Tlf: 00 00 00 00</p>
47. </div>
48. </div>
49. <div class="block block-menu" id="block-menu-72">
50. <h2>Produkter</h2>
51. <div class="content">
52. <ul class="menu">
53. <li class="collapsed"><a href="/test/?q=node/5">Link1</a></li>
54. <li class="collapsed"><a href="/test/?q=node/6">Link2</a></li>
55. <li class="leaf"><a href="/test/?q=node/13">Link3</a></li>
56. <li class="leaf"><a href="/test/?q=node/16">Link4</a></li>
57.
58. </ul>
59. </div>
60. </div>
61. </div>
62. <hr />
63. <div id="footer">
64. <p>
65. </p>
66. </div>
67. </div>
68. </body>
69. </html>
It is a bug in kubrick theme
Your XHTML is not valid because
<p class="postmetadata">paragraph is not closed. Seems like there is a bug in node.tpl.php file of kubrick theme. When there is no node links, this paragraph is not closed.You can probably fix it by changing
<p class="postmetadata"><?php if ($terms) { ?>Posted in <?php print $terms?> | <?php }; ?><?php if ($links) { ?><?php print $links?> »</p><?php }; ?>to
<p class="postmetadata"><?php if ($terms) { ?>Posted in <?php print $terms?> | <?php }; ?><?php if ($links) { ?><?php print $links?> »<?php }; ?></p>I hope this helps.
Drupal themes - themeartists.com
Yes it did
Thanks, the website is now valid.