Are XHTML style tag tags valid in HTML? I mean, in XHTML we use <link href="style.css" type="text/css" rel="stylesheet" />. Is it really in HTML? or should i use <link href="style.css" type="text/css" rel="stylesheet"></link>?
<link href="style.css" type="text/css" rel="stylesheet" />
<link href="style.css" type="text/css" rel="stylesheet"></link>
They are not valid in HTML4 for an element LINK.
LINK
Start tag: required, End tag: prohibited
But XML style tags, as in your question, valid in HTML5:
Authors may optionally choose to use the same syntax for void elements in the HTML syntax.
, HTML5 XML/XHTML. HTML5. XHTML application/xml+html, IE. text/html <!DOCTYPE html> , .
application/xml+html
text/html
<!DOCTYPE html>
<link> HTML. <link/> XHTML. XHTML text/html, , HTML, XHTML, HTML, XHTML, Content-Type - text/html, XHTML.
<link>
<link/>
HTML- xhtml HTML, , .
, , script , link . - w3.
script
link
To quote the W3 validator regarding self-closing tags:
A sequence can be interpreted in at least two different ways, depending on the DOCTYPE of the document. For HTML 4.01 Strictly, '/' completes the tag '). However, since many browsers do not interpret it this way, even with HTML 4.01 Strict DOCTYPE, it is best to completely exclude it in pure HTML documents and reserve its use exclusively for those written in XHTML.
Source: https://habr.com/ru/post/1765721/More articles:Delete a local Windows profile using PowerShell - powershellMultiple image selection using Ctrl + Click and uploading using PHP - javascriptCSS Div Positioning - htmlTrying to use my subnet address in python code - pythonMagento: Filter a custom product by its parameters - filterPoor opengl image processing performance - c ++Literals and objects - When to use what? - javascriptWhy doesn't this method work for assigning characters in JavaScript? - javascriptWebkit and SVG filter support - google-chromeHow do Haskell field labels work? - haskellAll Articles