We are working on :hover pseudo-class in IE 7, which works only if the docktype is


,but it decrement the font size of all element

please help me ..

  • This is really a question. If you edited the question a bit you might get more responses. – Tony C Jan 18 '10 at 15:32
  • Solve the font size issues, don't try to hack around them by hacking about with different Doctypes for different browsers. – Quentin Jan 18 '10 at 16:05

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...

  • no , i am not using any server side language – Tushar Ahirrao Jan 18 '10 at 15:38
  • That really limits what you can do. Basically, without a server-side language, you are stuck with displaying a static HTML page. – Zack Marrapese Jan 18 '10 at 15:40
  • can u tell me the solution – Tushar Ahirrao Jan 18 '10 at 15:42
  • There is a solution for your :hover thing, but it doesn't involve the doctype, and I don't know what it is. – Javier Jan 24 '10 at 22:21

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

  • but not work in IE 7 , and change the font of text means, it decrease all the font size – Tushar Ahirrao Jan 18 '10 at 15:41
  • It works in all IEs on anchors. If you're trying to make a div have a :hover style use jQuery for IE6(docs.jquery.com/Events/hover). As for your font size changing when you change the Doctype, are you setting a default font size on your body? alistapart.com/articles/howtosizetextincss – Jonny Haynes Jan 18 '10 at 16:02
  • 1
    Why do people down-vote but don't leave a comment as to why they've down-voted? That's just bad form. – Jonny Haynes Jan 21 '10 at 17:02
  • You were probably down-voted because you gave an "answer" that was just more questions. – Zack Marrapese Jan 25 '10 at 13:11

Your Answer

