Fri 6 Apr 2007
I cleaned my website and now it’s validated for xhtml and css.
I found out 4 important principles when you are changing your layout:
First, it has been always tricky to add an empty line and still keep your site validated. I have explained in my website about how to add a line in zencart. In Wordpress, it is different. You could use
<br/>
It will depend on your css file. If it does not work with one <br/> , then use 2 of them and have some spaces in between.)
<br/> <br/>
Please also see
Best Practice to add an empty line in xhtml for zencart
Second, To change the alignment for layout, you edit the css file or the Presentation files/templates (index.php, category.php, date.php, single.php…) by using theme editor or any other html editors. For good clean code, if you want to align the line to the center for example, you don’t have to add another <div>, <ul>, <li>, <span> or <p> inside one or another, you just have to put style=”text-align:center” in between the < , type, and >.
For example:
If you already have <li> and you need to change he alignment, change <li> to
<li style="text-align:center" >
Third, when you are changing codes between
<ul>….</ul>
, only add <li>….</li>
or add new code under betwen existing <li>….</li>
without using any of the new <div>, <span>, <ul> or <p>
Fourth, you never want to trust the code that you copied from other site to add to your site, even if it’s from a site like micromedia.com, w3.org (where you validate your xhtml) or creative commons because the structure of your website normally is never the same with theirs and they are not going to know where you are going to put the code.
For me to put the icon of the xhtml validated from w3.org in my footer file for WordPress, we have to take the <p> and </p> tags out from the code that w3.org gives you if where you want to add the code might be in <p> tag already.











