Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   CSS not cascading right (http://www.velocityreviews.com/forums/t159814-css-not-cascading-right.html)

Doug 10-29-2004 03:51 AM

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

rf 10-29-2004 04:13 AM

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.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57