Missed Closure Tags in source code

1

I started using CodeFormatter in sublimetext3 to sort the code. uses a style called psr2.

The issue is that it generates labels of closures for link, meta or br, that normally did not put them.

 <head>
    <meta charset="utf-8">
        <meta content="width=device-width, initial-scale=1" name="viewport">
            <meta content="IE=edge" http-equiv="X-UA-Compatible">
                <!-- CSRF Token -->
                <meta content="bRkaytOFL85XDRnXUu9rF41lkAnMpqLO6wGb7pAq" name="csrf-token">
                    <title>
                        Crear Articulo | Panel de Administración
                    </title>
                    <link href="http://emap.com.ar/css/admin.css" rel="stylesheet">
                        <link href="http://emap.com.ar/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
                            <link href="http://emap.com.ar/plugins/chosen/chosen.min.css" rel="stylesheet">
                                <link href="http://emap.com.ar/plugins/sceditor/themes/default.min.css" rel="stylesheet">
                                    <link href="http://emap.com.ar/plugins/datetimepicker/jquery.datetimepicker.min.css" rel="stylesheet">
                                        <link href="http://emap.com.ar/css/navbar.css" rel="stylesheet">
                                        </link>
                                    </link>
                                </link>
                            </link>
                        </link>
                    </link>
                </meta>
            </meta>
        </meta>
    </meta>
</head>

In principle it is more neat. But it occurred to me to see the source code from the browser. and All those closing tags place them in red and identify them as lost closing tags. trying I see that it does not give me any problem.

But I would like to know if this can know if this type normalization is right or I go backwards or if it brings me some problem later

    
asked by Cidius 05.10.2016 в 05:10
source

1 answer

0

According to the HTML5 specification, the "void" elements such as <meta> , <link> and <br> in this case, must NOT have a closing tag:

link

  

Void elements:

     

area, base, br , col, embed, hr, img, input, keygen, link, meta , param, source, track, wbr

     

Void elements only have a start tag; end tags must not be specified for void elements .

I do not know the plugin, but if you can disable the HTML processing it would be the best, or at least the head tags.

<head>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1" name="viewport">
  <meta content="IE=edge" http-equiv="X-UA-Compatible">
  <!-- CSRF Token -->
  <meta content="bRkaytOFL85XDRnXUu9rF41lkAnMpqLO6wGb7pAq" name="csrf-token">
  <title>Crear Articulo | Panel de Administración</title>
  <link href="http://emap.com.ar/css/admin.css" rel="stylesheet">
  <link href="http://emap.com.ar/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  <link href="http://emap.com.ar/plugins/chosen/chosen.min.css" rel="stylesheet">
  <link href="http://emap.com.ar/plugins/sceditor/themes/default.min.css" rel="stylesheet">
  <link href="http://emap.com.ar/plugins/datetimepicker/jquery.datetimepicker.min.css" rel="stylesheet">
  <link href="http://emap.com.ar/css/navbar.css" rel="stylesheet">
</head>

On the other hand, PSR-2 is the PHP code style, which I recommend that you use it in your project, but it has nothing to do with the HTML code.

Here is the PSR-2 documentation: link

    
answered by 05.10.2016 / 05:35
source