Forum Moderators: open

Message Too Old, No Replies

there is no attribute "LEFTMARGIN"

Problem with html validation

         

akvario

12:06 pm on Mar 2, 2003 (gmt 0)

10+ Year Member



The html validator says :
"Line 12, column 35: there is no attribute "LEFTMARGIN" (explain...). "

And reffer to the following tag :

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="40" marginwidth="0" marginheig
^

What could be wrong?

hakre

12:13 pm on Mar 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi akvario,

the use of the attribute leftmargin is permitted. do not use this attribute with the current doctype of your document. use css (cascading style sheets) to to the same instead.

tedster

5:42 am on Mar 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just for clarity's sake, I believe that hakre skipped typing the important word "not" -- as in "not permitted".

Leftmargin, topmargin, etc were never including in the HTML recommendations of the W3C for any version. As hakre mentions, there are CSS solutions and those are what is recommended.

A site search here on "leftmargin" or "topmargin" will turn up many helpful threads. In short, to get rid of the gaps at the side of your design, you probably want a CSS rule something like this:

body {
margin: 0;
padding: 0;
}

hakre

7:25 am on Mar 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yeah tedster, you're right. i missed the not. ups ;-).

akvario

11:19 am on Mar 3, 2003 (gmt 0)

10+ Year Member



Thanks for an informative answer Tedstster! I got i right now..

One more thing.. I'd like to have my <Table> in center.. I've used <table align="center"> but the valdator dont like it..

What should i use insted?

Birdman

11:51 am on Mar 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Wrap the table with a <div></div>.

<div style="text-align: center; margin: auto;">
<table style="text-align: left;">
</table>
</div>

I added the style to the table tag because all the text would be center aligned. It is amazing what can be done using CSS [w3.org] with XHTML1 [w3.org] .