Hi everyone
is it possible, in HTML, to insert the <head> after the closing tag </body>? Or do I have to code before the <head> and after the <body>?
I was reading at w3schools.com about css, and it sais:
"Note: If the link to the external style sheet is placed after the internal style sheet in HTML , the external style sheet will override the internal style sheet!"
the question is how can I put and external style sheet after an internal style sheet if the external style sheet is declared in the head which is always before the body?
No.
An HTML element must consist of exactly one HTML element with its children being one HEAD element and one BODY element, in that order.
The start and end tags for all three of those elements are optional, but you can't explicitly place them in any other order.
Browsers will attempt error recovery if you place the HEAD after the BODY, but you shouldn't depend on this.
external style sheet after an internal style sheet if the external style sheet is declared in the head which is always before the body?
You are confusing internal stylesheets (defined with the <script> element, which (like <link> which is used for external stylesheets) must appear in the <head>) with inline styles (defined by the style= attribute, which can appear on almost any element, including most that appear in the <body>.
Nothing about the order that stylesheets appear in can alter the influence of inline style, since they will always have a higher specificity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With