SEO forum : Search Engine Optimization Forum

SEO forum : Search Engine Optimization Forum (http://www.seo-guy.com/forum/index.php)
-   HTML Forum (http://www.seo-guy.com/forum/forumdisplay.php?f=35)
-   -   How to replace these attributes using CSS (http://www.seo-guy.com/forum/showthread.php?t=11382)

sparrowhawk 02-20-2006 06:46 PM

How to replace these attributes using CSS
 
I am trying to get my homepage to validate using the W3C validator. I have only 4 attributes that I can't seem to replace with external styles.

the attributes modify the body element:
leftmargin
topmargin
marginheight
marginwidth
so like:
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

I found a solution using absolute positioning:

body {
position: absolute;
top: 0;
left 0;
}

The problem is that I want to keep my page design centered:
http://www.ajmoss.com/
if you care to see what I mean.

Thanks in advance.

Here's the validation issue - this may explain better than I have:
http://validator.w3.org/check?uri=h...200=1&verbose=1
(I hope it's ok to link to the W3C validation tool)

RyanSmith 02-20-2006 07:47 PM

Check out:
http://maxdesign.com.au/presentation/page_layouts/

They have lots of neat tricks for layouts in CSS

http://www.petefreitag.com/item/475.cfm

also has some neat CSS tricks. I think what you probably want to do is get rid of the table and replace it with a DIV that has

margin: 0px auto 0px auto;

Or something like that.

sparrowhawk 02-20-2006 07:58 PM

Quote:
Originally Posted by RyanSmith
Check out:
[url] I think what you probably want to do is get rid of the table and replace it with a DIV that has

margin: 0px auto 0px auto;

Or something like that.


That would work, and I've thought about redesiging the whole site using <div> tags, and css positioning. I was just wondering if there is a way to modify the body element and accomplish the same effect while still keeping the tables.

can I apply the above to the body element - like:
body {
margin: 0px auto 0px auto;
}
???

sparrowhawk 02-20-2006 08:02 PM

I realized I was being a jerk asking when I could just try it out. That worked great and now my page totally validates. Thanks so much.

jlknauff 02-22-2006 05:30 AM

And it would have taken less time too ;)

catanich 01-23-2007 01:42 PM

How about the following

body {
margin-top: 10px;
margin-right: 10px;
margin-bottom: 10px;
margin-left: 10px;
}

and replace the 10px to 0 px. This validates.

Jim Catanich


All times are GMT -8. The time now is 01:32 PM.

Powered by: vBulletin Version 3.0.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.