Hi there!

Hello there.<br />
I hope you can help.<br />
<br />
My website validates locally as valid HTML 4.01 transitional, but I'm now trying to get it to validate as 4.01 strict.<br />
It's saying that things such as align/background/target/bgcolor/text/width/border/height are not valid attributes.<br />
Does this mean i.e. for background that I could use <body style="background: url('lines.gif');">?<br />
<br />
Thanks.<!--content-->You have pretty much the right idea. In HTML 4.01 Strict (and all versions of XHTML), it wants you to use CSS for presentational purposes (which is what it's meant for) instead of using presentational markup. So, as you said, you use CSS instead of using the background attribute on the <body> tag. All of the attributes you mentioned can be replaced with CSS, so if you need anymore help getting your page to validate, please feel free to ask.<!--content-->Hello there, thanks for your kind reply.<br />
<br />
Can I just confirm I have the right way of doing things.<br />
Obviously I could put these together when needed, but on their own:<br />
<br />
style="align: center;"<br />
style="background url(lines.gif);"<br />
style="bgcolor: #FFFFFF;"<br />
style="text: #FFFFFF;"<br />
style="width: 150px;"<br />
style="border: 1px";<br />
style="height: 150px;"<br />
<br />
Two questions also, it says target is invalid in a href to open in a new window, i used target="_blank" what should I use?<br />
Also, on that question, is it worth using XHTML 1.0 strict now?<br />
<br />
thanks!<!--content-->You're quite welcome. Just for clarification:<br />
To align an inline-level (doesn't take up its own line) element to the center of the page:text-align: center;<br />
To align a block-level element (does take up its own line) to the center of the page:margin: 0 auto;<br />
To set the background-image of an element:background-image: url(foo.gif);<br />
To set the background-color of an element:background-color: color;<br />
To change the text color of an element:color: color;<br />
To set the width of an element (use any unit you'd like):width: 20em;<br />
To set the height of an element (again, use any unit you'd like):height: 20em;<br />
To set the border of an element (the following code yeilds a solid black one pixel border, you can simply change the style of the border, the color, and the width to whatever you want):border: solid #000000 1px;Originally posted by skydan <br />
it says target is invalid in a href to open in a new window, i used target="_blank" what should I use?As you mentioned, under certain DOCTYPEs, certain attributes are deprecated. In this case, target is. To emulate this effect, you'll have to resort to JavaScript:<a href=http://www.webdeveloper.com/forum/archive/index.php/"foo.html" onclick="target='_blank';">bar</a>Originally posted by skydan <br />
Also, on that question, is it worth using XHTML 1.0 strict now?That's really up to you. However, either choice would be fine.<!--content-->Hello there again.<br />
Thanks for your replies! :)<br />
<br />
Just a quick question. I have a main external css file with all input style css, buttons, font, div's etc. Is it "wrong" to put style=".." in an actual tag, and not external css? personally, i'd prefer to have it in the actual file itself, or is it wrong to do so?<br />
Also, Does it slow it down in anyway?<br />
<br />
Thanks for any information.<!--content-->Originally posted by skydan <br />
I have a main external css file with all input style css, buttons, font, div's etc. Is it "wrong" to put style=".." in an actual tag, and not external css? personally, i'd prefer to have it in the actual file itself, or is it wrong to do so?It isn't necessarily "wrong", but if you're going to use that CSS on multiple pages, then it of course makes sense to just include the external file with all of the CSS rules defined in it.Originally posted by skydan <br />
Also, Does it slow it down in anyway?I don't think you'll notice much of a difference in the loading of the page except for on the first time you access it since everything on the page is cached.<!--content-->Hi there.<br />
The header and footer are called from each php page, so for that i will use the style="." tags and then for hte other pages i think i'll do the same.<br />
I've used external CSS for enough in my view, and prefer these style attributes.<br />
Thank you again.<!--content-->You're quite welcome. :D<!--content-->The rule(s) of thumb(s) ??? are:<br />
<br />
If the style is to be used across many pages on a site then it belongs in a separate style sheet.<br />
<br />
If the style is to be used globally on a single page then it should be "imbedded". That is, it should be in a <style> section in the <head>.<br />
<br />
If the style is specific to a single instance of an element on a page then it can be put into the element's tag; "inline".<!--content-->
 
Back
Top