Which doctype should I use, if I want to use costumizable divs. With divs animation, images moving, setting div opacity, etc.
I've tried to create a div through javascript, setting its background-color, position, width and height, and adding an onmouseover event to it.
Everything works ok untill I wanted to put a doctype at my html.
I've tried the transitional and strict, both made my div disappear.
So I've inserted the HTML5 type of doctype and my div appeared ok.
Well, I want to make my website with html4.
Is it possible?
Correct Option: Ddoctype html>, doctype is the very first thing to write in HTML5.
The most popular DOCTYPE nowadays is the HTML 5 doctype ( <! DOCTYPE HTML> ) which is used with very little hiccups. The most popular/safest doctype used to be the <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> doctype.
doctype html> or <! This is because, html5 is a SGML based, unlike HTML4. 01 or XHTML1. As soon a browser finds <! doctype html> in the starting of an HTML document, it represents the document in standard mode.
Yes you should put the doctype in every file. If you don't put a doctype on a document, browsers will go into quirks mode when rendering that document. And you (and your users) don't want browsers to use quirks mode to render your documents.
Everything I've read lately seems to say that you should just use a plain doctype so the browsers can use the latest rendering standards.
<!DOCTYPE HTML >
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