On Sunday, August 14, 2011, 7:54:29 PM, Geoff Lane wrote:

> On Sunday, August 14, 2011, 6:23:01 PM, Ghodmode wrote:

>> I think you can use a <style></style> block in the body.
> ---

> Thanks. For some time I've been under the impression that you could
> only use <style>...</style> in the head. However, I'll give that a try
> and report back whether it works.
---

I've given a style block in the body of a page a go and to my surprise
it works in IE5.5 onward, as well as the latest versions of Firefox,
Chrome, Opera, and Safari. One learns something new every day. Again,
many thanks.

However, I ran the result through the W3C validator, and it took a
dislike to the style block, complaining that the 'scoped' attribute
was mandatory. When I added the missing attribute, it warned that
browsers don't yet support it and that I'd be better off waiting for
browser support!

FWIW, here's the style block I ended up with:

<style type="text/css" scoped="scoped">
        a.pc:link, a.pc:visited, a.pc:active, a.pc:hover {
                padding: 0 20px;
                margin: 1px;
                text-align: center;
                font-family: sans-serif;
                font-weight: bold;
                color: white;
                text-decoration: none;
        }
        a.pc:link, a.pc:visited {
                background-color:#b0b0b0;
        }
        a.pc:active, a.pc:hover {
                background-color:#808080;
        }
</style>

Thanks to all who responded both on and off list.

-- 
Geoff

______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to