The answer is that it should not be displayed in any of the main browsers.
As noted by a few comments, you should not do this; you violate the standards, which means that the result is undefined - that is, it should work, but you cannot be sure.
I understand that in some cases (i.e. when working with a poorly developed CMS), it may be the only option available, but in general it is bad.
If you really need to do this and you are worried about it, one solution would be to put the content in the HTML comments:
<style type="text/css"> <!-- .slideshow img { display: none } .slideshow img.first { display: block } --> </style>
This should block it from being viewed even by browsers that don’t like having a <style>
in the body.
Another option is to put it in an external stylesheet file and include it using the <style>
. This should still work, but since the element will not have direct content, it will not have anything to display a poorly displayed browser.
Hope this helps.
source share