Web Hosting Talk







View Full Version : Converting tags like topmargin to valid xhtml


spiros
06-23-2005, 10:58 AM
I tried to validate a test page and amongst other things I get this
(First I used Dreamweaver's MX convert to xhtml):

there is no attribute "topmargin", leftmargin, topmargin, marginwidth, marginheight
this is usually fixed by using CSS to achieve the desired effect instead).

there is no attribute "background"

...acing="0" cellpadding="0" background="images/backd.gif">



This is the code I have now
<body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" vlink="#FF6633" link="#FF6600" background="../images/home.gif">

I use these attributes so as not to have extra margins on my site but I am not sure how to move them to the css. Similar with the bacground attribute Any css gurus there?

Corey Bryant
06-23-2005, 01:36 PM
Check out CSS Margin Properties (http://www.w3schools.com/css/css_margin.asp)

You can use something like:
<style type="text/css">
body
{
margin: 0
}
</style>
And I would also take a look at CSS Pseudo-classes (http://www.w3schools.com/css/css_pseudo_classes.asp) to apply the appropriate classes to your hyperlinks as well.