tags:

views:

72

answers:

5

When I use the validator, it says that

the align attribute on the div element is obsolete. Use CSS instead

What do I do to resolve this?

+1  A: 

Use style attribute. For example:

<div style="text-align:center"></div>
Antony Highsky
This is NOT the same!!!
BlaXpirit
A: 

Do not use

<div align='left'>lefty</div>

Use

<div style='text-align:left'>lefty</div>
superUntitled
I don't think that `align` is a CSS attribute...
Delan Azabani
floating left is completely different than aligning left - align left aligns the CONTENT - floating floats the ELEMENT
Dan Heberden
+3  A: 

Add a text-align declaration to a style block for .abcd:

.abcd { text-align: left; }

or set the style of the div itself locally:

<div class="abcd" style="text-align: left;">
Delan Azabani
you need not use "text-align: left;" if you already handle it in class.
Salil
...which is why I said *or* for the second suggestion :D
Delan Azabani
A: 

Don't

1] <div align='left'></div>

Do

1] <div style="text-align:left"></div>

OR

2] .divClass { text-align: left; }
   <div class="divClass"></div>  
Salil
This is NOT equivalent!!!
BlaXpirit
+1  A: 

text-align ... is align of a text

align="center" all goes to the center..

so How can i put a div on center with css

steven spielberg