Can I add a CSS style block within the body of a page?

I am using a CMS (Sharepoint) and need to add some CSS to a page. Unfortunately, I can only edit and add code within the body of the page using the CMS WYSIWYG editor. We can’t touch the head area. So, I need to add this CSS to the page (can’t link to a file, can’t put it in header). Here’s what I’m trying to put on the page body:


<style>
.found {background-color:#f99;}
#searchbox {width:350px; position:absolute;
_top:expression(document.body.scrollTop+document.body.clientHeight-this.clientHeight-10);
left:10px; bottom:10px; background-color:#ccc; border:2px outset #ccc; padding:1px;}
body > #searchbox {position:Fixed;}
#searchbox fieldset {border:0;text-align:center;margin:3px;}
#searchbox input {margin:1px;padding:2px;}
#search {width:160px;}
</style>

Surprisingly, it works in IE and FF, but not in the CMS. I’m guessing the CMS may be stripping it away? If I also add a CSS RESET to this css style block, will that help?

Just wondering if there’s a way to get this CSS in the body. Thanks guys.

NO. The style tag is only valid code within the HEAD tag of a page. Even if it “seems” to work in some browsers, it’s just not a good idea.

You can use the style attribute in specific tags within the body of an HTML document, but you can’t create a “style sheet” to affect anything else but that tag itself. eg <p style=“width:160px;” >. The downside is that inline CSS is just not efficient, the upside is that inline CSS rules supersede any stylesheet!

I find it hard to believe that your CMS wouldn’t allow to import additional style sheets. How is styling done in the CMS to begin with?