我应该使用哪种文档类型? [英] Which doctype should I use?
问题描述
我试图通过javascript创建div,设置其背景颜色,位置,宽度和高度,并添加一个onmouseover事件给它。
一切正常,直到我想把一个文档类型放在我的html。
我尝试过渡和严格,都使我的div消失。
所以我插入了HTML5类型的doctype,我的div似乎很好。/ p>
好的,我想用html4制作我的网站。
这可能吗?
我最近阅读的所有内容似乎都表示,您应该只使用简单的文档类型,以便浏览器可以使用最新的渲染标准。
<!DOCTYPE HTML>
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?
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 >
这篇关于我应该使用哪种文档类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!