css old method When I use the validator, it says that the align attribute on the div element is obsolete....">

<div align = "left" class = "abcd"> css old method

When I use the validator, it says that

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

What should I do to solve this problem?

+3
source share
4 answers

Use a style attribute. For instance:

<div style="text-align:center"></div>
+2
source

Add an ad text-alignto the style block for .abcd:

.abcd { text-align: left; }

or locally set the style div:

<div class="abcd" style="text-align: left;">
+4
source

Do not use

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

Using

<div style='text-align:left'>lefty</div>
+1
source

Not

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

Do

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

OR

2] .divClass { text-align: left; }
   <div class="divClass"></div>  
0
source

Source: https://habr.com/ru/post/1749155/


All Articles