HTML Doctype very first thing? [duplicate] - html

This question already has answers here:
Does my HTML5 doctype have to be on the VERY first line?
(6 answers)
Closed 9 years ago.
Is it valid to have blank line returns preceding the doctype declaration?
The <!DOCTYPE> declaration must be the very first thing in your HTML
document, before the <html> tag.
via w3schools

Not necessarily; BOM, whitespace and comments may come first.
http://www.w3.org/TR/html-markup/documents.html#syntax-document-html
So yeah, it must come first, before any actual HTML tags, but note that you can't really ever put doctype before BOM.

Related

Is <html lang="en"> important? [duplicate]

This question already has an answer here:
Consequences of not using a lang attribute in an html5 html tag
(1 answer)
Closed 5 years ago.
I just wanted to ask if the tag is really that important... Do I need to use it if I am developing a website?
Will it affect my code if I don't put it?
It's important for accessibility reasons, not codewise.
It's mainly used for translations "bot".
If you really want it to be perfect, then use <html lang="en-US"> or the appropriate country code for your language (like mine is fr-FRand not fr-CA since there are differencies between those two languagues).

Use if IE CSS in body? [duplicate]

This question already has an answer here:
Why is IE11 Ignoring Conditional Comment
(1 answer)
Closed 6 years ago.
I'm working with a really broken CMS and only have access to just below the opening body tag. I, unfortunately, had to input my CSS in there but of course now I need custom IE styling. <!--[if IE]> doesn't seem to be working in the body. Is there a way around this?
Thanks to Turnip, I now know IE 10 and up doesn't allow for conditional comments.

Does DOCTYPE have to be in uppercase in HTML5? [duplicate]

This question already has answers here:
Uppercase or lowercase doctype?
(7 answers)
Closed 7 years ago.
Does DOCTYPE have to be in uppercase in HTML5?
The start of an HTML5 document is usually written as:
<!DOCTYPE html>
...but is the lowercase also valid?
<!doctype html>
In HTML, the DOCTYPE is case insensitive.
You can find more info here: https://www.w3.org/TR/html5/syntax.html#the-doctype
Unlike earlier versions of HTML, in HTML5 the doctype declaration is case-insensitive. In other words works as well as . Check here: http://www.html-5-tutorial.com/doctype.htm

Importance of Doctype in HTML [duplicate]

This question already has answers here:
What is the functionality of !DOCTYPE?
(5 answers)
Closed 7 years ago.
In modern HTML, is there a purpose to having a Doctype tag to start an HTML page? I'm wondering because when I add or remove it, nothing changes.
It helps the browser render the code correctly.

Why HTML 5 Remove Some Elements? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I just wanted to know why html 5 remove following elements please give me answer Its also asked to me in Interview....
The following HTML 4.01 elements are removed from HTML5:
<acronym>
<applet>
<basefont>
<big>
<center>
<dir>
<font>
<frame>
<frameset>
<noframes>
<strike>
<tt>
The following elements are not in HTML 5 because their effect is purely presentational and their function is better handled by CSS:
basefont
big
center
font
strike
tt
The following elements are not in HTML5 because using them damages usability and accessibility:
frame
frameset
noframes
The following elements are not included because they have not been used often, created confusion, or their function can be handled by other elements:
acronym is not included because it has created a lot of confusion. Web developers are to use abbr for abbreviations.
applet has been obsoleted in favor of object.
isindex usage can be replaced by usage of form controls.
dir has been obsoleted in favor of ul.
See Details W3C
You can find the answers (though a bit short) in the Differences from HTML4 TR. There, you can also click a particular element of choice to see a more detailed explanation and/or replacement.
Anup not only those tags there are lot of other things which are deprecated in html5. Reason is their function is better handled by CSS.
Please look at this list of deprecated tags in html5 http://www.tutorialspoint.com/html5/html5_deprecated_tags.htm