The html5 specification in the description of the meta element states the following:

And charset, attributes must be specified.

Approximate translation: Only one of the attributes can be used: name, http-equiv, or charset. Do I understand correctly that I can not write like that?

<meta name="author" content="Sergey" charset="utf-8"> 

Those. either I am writing in one html document

 <meta name="author" content="Sergey"> 

or

 <meta charset="utf-8"> 

Suppose if I want to specify the author Sergey i. like so

 <meta name="author" content="Sergey"> 

how can I, in order to comply with the html5 standard, also specify the utf-8 encoding, because according to the standard one cannot use meta name and utf-8 at the same time? Or maybe I have translated the standard incorrectly?

    1 answer 1

    Do I understand correctly that I can not write like that?

     <meta name="author" content="Sergey" charset="utf-8"> 

    Right. Since the meta element allows you to specify only one of the three characteristics (name, charset, http-equiv) of the document at a time .

    In this case, you need to write:

     <meta name="author" content="Sergey"> <meta charset="utf-8"> 

    Since the number of meta elements is not limited to one copy of it, with the exception of <meta charset="что-то там"> , because it must be given once.