Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xhtml newbie question

Status
Not open for further replies.

mplbm

Programmer
Feb 9, 2006
24
0
0
GB
I've just started to use VS 2005 and am trying to make an old project XHTML compliant. What is the replacement for the attributes bgcolor and width, and the element font? Are they meant to be replaced by CSS?


Thanks,

Mike
 
The elements I am using "width" with in the project are td and table.


Thanks,

Mike
 
According to the validator in VS 2005, width is no longer a valid attribute for <td>. What do you need to use instead?


Thanks,

Mike
 
This doesn't seem a very useful step forward for HTML, if this is how you are now supposed to set td width...it's not something you would want to put in a css file because you could have many td's all with different widths on just one page. Why is it necessary to use style="width:100px;" instead of width="100px"? Anyhow, thanks for your help!


Cheers,

Mike
 
it's not something you would want to put in a css file because you could have many td's all with different widths on just one page
But if you created a class for each width, you could assign the class to the td tag. Any changes to this class would instantly be reflected throughout the whole site.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I'm using tables for layout...I know I should eventually learn how to do the layout in CSS, but at the moment I have too many other new things to learn...


Thanks,

Mike
 
Why is it necessary to use style="width:100px;" instead of width="100px"?

Because the aim of these "refinements" to HTML and related technologies is to completely separate the content from the way it's presented. If you remove the styling info from an HTML document it becomes much easier to reuse the content for other devices/media etc.

HTML should be used to define the structure of a document and not how it looks.


Foamcow Heavy Industries - Web design and ranting
Buy Languedoc wines in the UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top