Embedding extra styles with noscript

前端 未结 7 1756
盖世英雄少女心
盖世英雄少女心 2020-12-08 05:18

I have an XHTML strict page that has an invisible div that is controlled by Javascript. The div is set to transparent and visible by the script and a mouseover event to make

7条回答
  •  没有蜡笔的小新
    2020-12-08 05:28

    To clear up the validation issue: noscript is only allowed in the body element, style only allowed in the head. Therefore, the latter is not allowed within the former.

    On the general issue: you'll want to make the div element visible by default, then hide it via CSS + javascript. This is the 'progressive enhancement' model. I notice you say you "don't want to do this because of the flicker", but I'm not sure exactly what's causing this - chances are you can fix it, so maybe you should post that as a question.

提交回复
热议问题