6 replies [Last post]
earph
earph's picture
Offline
Enthusiast
Austin, TX
Last seen: 14 years 2 weeks ago
Austin, TX
Joined: 2003-11-12
Posts: 62
Points: 0

I'm using W3C MarkUp Validation Service http://validator.w3.org/ to check my code and I'm coming up with some errors that I can't figure out.

Here's the page that I'm checking: http://www.expresiv.com/2004/company/index.asp

If you validate it, you'll notice that it'll have errors claiming

Quote:
Line 10, column 34: there is no attribute "MARGINHEIGHT" (explain...).
<BODY class="mainBG" marginheight="0" marginwidth="0" topmargin="0" leftmargin="

There are other errors similar to this listed. Does anyone know how to fix it? I've done everything..... I've tried everything.....

Anyone have any ideas? Thanks ahead of time!

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 week 3 hours ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5344
Points: 2965

W3C MarkUp Validation Service

Hi skillet,
Remove the attributes pointed out by the validator and replace them with CSS.

<style type="text/css"> 
body{margin:0;} 
</style>

Daybreak_0
Offline
Enthusiast
Sydney, Australia
Last seen: 19 years 19 weeks ago
Sydney, Australia
Timezone: GMT+10
Joined: 2003-11-15
Posts: 389
Points: 0

W3C MarkUp Validation Service

Tony's answer sets the margin around the body as 0 (zero) for all four sides.

You can also have this which allows you to change margins individually
body{
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
margin-left: 0px;
}

or

body{
margin: 0px 0px 0px 0px
} (relates from top to left clockwise)

Day

The only way to learn is to do it yourself

earph
earph's picture
Offline
Enthusiast
Austin, TX
Last seen: 14 years 2 weeks ago
Austin, TX
Joined: 2003-11-12
Posts: 62
Points: 0

W3C MarkUp Validation Service

Thanks... I managed to get it.

I've having a trouble setting the padding of my table cells now. I have this code:<TABLE width="100%" height="65%" border="0" cellpadding="4" cellspacing="0">
I need to convert it to CSS.... Do I use margins or padding, or what? The border gets messed up too, along with the cellspacing. Nothing I do seem to work.

You mind giving an example?

Thanks![/code]

Sven
Sven's picture
Offline
Enthusiast
Brisbane, Australia
Last seen: 15 years 42 weeks ago
Brisbane, Australia
Timezone: GMT+10
Joined: 2003-03-12
Posts: 166
Points: 0

W3C MarkUp Validation Service

Assuming the table is given the class name "myTable" (how original!), give this a try:

table.myTable {
   width:100%;
   height:65%;
   border:0;
   border-collapse:collapse;
}

table.myTable td {
   padding:4px;
}

There is a table css property called border-spacing, but it's unsupported by IE. However, border-collapse:collapse gives the same effect as border-spacing:0, so that shouldn't be a problem.

Let us all know how the validation goes...

firstreflex
firstreflex's picture
Offline
Enthusiast
Brooklyn USA
Last seen: 16 years 4 weeks ago
Brooklyn USA
Timezone: GMT-5
Joined: 2003-10-21
Posts: 104
Points: 0

W3C MarkUp Validation Service

I would think this would work:

table {
width: 100%;
height: 65%;
}
td {
padding: 4px;
border-width:0;
}
<table cellspacing="0">

firstreflex
firstreflex's picture
Offline
Enthusiast
Brooklyn USA
Last seen: 16 years 4 weeks ago
Brooklyn USA
Timezone: GMT-5
Joined: 2003-10-21
Posts: 104
Points: 0

W3C MarkUp Validation Service

I learnt how to style tables from Eric Meyer on CSS where he says to leave cellspacing in the mark-up (for IE). On further reseach border-colapse:collapse is definitely the way to go.
What does that guy know anyway. Wink