The align attribute is deprecated. Newer Construct is recommended ... What is the newer design?

I am currently creating several sites with visual studio 2010 using C #. The only error (message) I left, or with imgalign, divalign and <a nameatrributes ... which is considered deprecated. A newer design is recommended.

Sites still work, but since I am involved in the learning process, I want 0 errors / messages ... I can not find anywhere on the network that says that the new design replaces them.

Can anyone help?

+3
source share
4 answers

float, div margin, text-align , . ( ) -. 0/auto auto/0 auto/auto. , .

id .

, , , :

<p><a name="example">The quick brown fox jumped over the
lazy dog</a></p>

, , - :

<p><a name="example"></a>The quick brown fox jumped over the
lazy dog</p>

:

<p id="example">The quick brown fox jumped over the
lazy dog</p>
+6

CSS - - .

+4

What you can do is replace

align="center"

with

style="text-align:center"

This will fix the validation error you get and also satisfy the XHTML rules by adding inline CSS style.

+3
source

Use cascading style sheets instead of formatting HTML.

New design:   .rule { margin: 0px auto; }

+1
source

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


All Articles