hi Rama, I did suspect that initially but then it's quite common to
see stylesheet containment done from within the <body element and to
make it even worse, this works very well with any major UserAgent i
have managed to get my hands on and tested (IE, firefox, Opera,
Safari).
Also while it will be like comparing apple and oranges, i still do
see a relation with the javascript containment and how script
containment from within the <body is quite common and is the default
for pretty much all of the ajax extentions library.
The browser reads a
page from top to bottom fashion so i can't imagine a valid reason why
this might be a problem to have css containment done from within the
body as long as the content using the css follows.
I have however done some more research since and while the w3c is
vague in their specification as to what the UserAgent should follow, I
do not read anywhere on the w3c where they state explicitly that this
is not allowed anywhere outside the <head element. An interesting
document i found is the following :
www.w3.org/.../styles.html
I have gone the extra mile to validate an xhtml document against the w3c validator and surprisingly i got my answer :
The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).
Seems like a pretty much conclusive and definitive answer.
So why are all browsers forgiving when css containment is done from within the <body ? I feel this shouldn't be working in the first place, but it does.
Oh well, to cut a long rant short, I have changed my position on this being a bug in IE (since IE only fails to forgive css containment from within the body, if it's done through script, however something that shouldn't be working or supported anyway as per the specs).
Leaves a lot of room for confusion since while the validator verifies that a violation of the specifications has occurred, it's a violation that most UserAgents ignore, inlcuding IE, except in the scenario i presented here in this post.
I also need to fix my workaround since while presenting a solution, by including the css outside the updatepanel content area, it still violates the xhtml specs, in that css containment is done from within the <body. Please read the update i have added in the post itself above.
Thanks for response and a happy new year.