![]() |
CSS not cascading right
Well... i guess it's cascading right, but not like I want it to. Say I have a div to mark the main section of the page with an id of main. <div id="main-copy"> ... <a href="foo.html>LinkName</a> ... </div> then in my stylesheet i have #main-copy a I also have links in the main-copy where i want it to override the other rule. <a class="location" href="tallahassee.html">Tallahassee</a> This rule doesn't change the color: a.location { color: #990000; font-size:90%; font-style:italic; text-decoration:none; } So, I could do #main-copy .location a but then I would have to do this for every section of the page (with many rules for the :hover, :link etc). #side-bar .location a #header .location a Is there any way around this, where i could only state this once in the stylesheet? -d |
Re: CSS not cascading right
Doug wrote
> > Well... i guess it's cascading right, but not like I want it to. You are talking about inheritance, not cascading. > Say I have a div to mark the main section of the page with an id of main. > > <div id="main-copy"> > ... > <a href="foo.html>LinkName</a> > ... > </div> > > then in my stylesheet i have > > #main-copy a and what comes after this? > I also have links in the main-copy where i want it to override the other > rule. > > <a class="location" href="tallahassee.html">Tallahassee</a> > > This rule doesn't change the color: > > a.location { > color: #990000; > font-size:90%; > font-style:italic; > text-decoration:none; > } Do you have other rules like a.location:link etc > > So, I could do > #main-copy .location a > but then I would have to do this for every section of the page (with > many rules for the :hover, :link etc). > #side-bar .location a > #header .location a Ah, the plot thickens. > Is there any way around this, where i could only state this once in the > stylesheet? I can not see the problem. You will have to provide a URL to the page that exhibits this behavoiur. It is pointless looking at one little bit of the CSS. -- Cheers Richard. |
| All times are GMT. The time now is 02:37 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.