开发者

How to use if else condition to change doctype according to the browser in html file.?

We are working on :hover pseudo-class in 开发者_如何学编程IE 7, which works only if the docktype is

< !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd">

,but it decrement the font size of all element

please help me ..


HTML itself doesn't have any built-in server-side processing. Therefore, it doesn't have the ability to alter itself prior to the response going out.

You have access to javascript, but this is done on the client side, and at that point the browser has already interpreted the doc type.

If you are using a server-side programming language to generate your HTML, then you could include an if statement there, although changing the doctype just so that styling will work correctly is a questionable practice...


What do you mean

it change the font of text

Changing a Doctype shouldn't affect anything on the page, except how it validates.

Also what do you mean by

:hover pseudo-class

:hover works just fine in IE6

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜