我应该使用哪种文档类型? [英] Which doctype should I use?

查看:104
本文介绍了我应该使用哪种文档类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该使用哪种doctype,如果我想使用costumizable的div。使用div动画,图片移动,设置div不透明等。

我试图通过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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆