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
I wrote this post after realizing it was dating from 2008
Since I had a similar problem, I thought continuing answering with a current answer.
Like Boby Jack said, style
tag is not allowed in body. I myself did the exact thing as you (Joshua) about it. But Jack's "progressive enhancement" made me without non-abstract solution but then I realized a solution that I did not find answers on this thread.
It all depends of your styling structure.
My suggestion is to plainly use something like modernizr
in the very begining of the head and use Paul Irish's HTML5Boilerplate recommendations.
class
attributes with no-js
.hide-me
) with display:none
on its proper place.no-js .hide-me { display:block }
See Paul Irish's HTML5boilerplate, and adapt it to XHTML if you want :)
.no-js
quoting from html5boilerplate.com
Modernizr execution will build html
attributes with what's supported.
Will build something similar to this:
Note this is from Google Chrome modernizr
tests.
The first is js
but if Modernizr did not run (no javascript) the no-js
would stay there.
.hide-me
) with display:none
on its proper place... you know the rest :)