|
Posted by Toby A Inkster on 12/19/07 17:45
guiderocksalt wrote:
> The style rule below will match the p element that has an id with a
> value of "para1":
>
> p#para1
As Els says, your stylesheet might have:
p#para1 { ... }
b#para1 { ... }
i#para1 { ... }
Yes, on any given page, only one of the above can exist; but multiple
pages are allowed to reference the same stylesheet, so perhaps on one page
there is a p#para1 and on another page there is a b#para1!
Also, you might have something like this:
div#highlighted, p#highlighted /* and other block elements */
{
padding: 0.67em;
background: yellow;
margin: 0.33em;
}
span#highlighted /* and other inline elements */
{
background: yellow;
text-decoration: underline;
}
And then on the page use a piece of Javascript to highlight specific
elements by setting the "id" attribute to "highlighted" and unsetting it
when you want the highlight to go (but making sure there are never two
elements with the same ID!)
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 12 days, 4:15.]
Sharing Music with Apple iTunes
http://tobyinkster.co.uk/blog/2007/11/28/itunes-sharing/
[Back to original message]
|