Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > CSS not cascading right

Reply
Thread Tools

CSS not cascading right

 
 
Doug
Guest
Posts: n/a
 
      10-29-2004

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
 
Reply With Quote
 
 
 
 
rf
Guest
Posts: n/a
 
      10-29-2004
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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I would like to create a vertical cascading menu using javascript and css - looking for guidelines Terry Javascript 14 10-05-2007 12:57 PM
Learn CSS (Cascading Style Sheets) with simple tutorials Software Engineer C++ 0 04-01-2007 11:16 PM
Q: cascading events not working? Matt C. ASP .Net 0 06-26-2006 05:11 PM
Cascading Style Sheets (CSS) question- LI items in horizontal display bbcrock@gmail.com HTML 2 01-31-2006 01:59 AM
Win Explorer (C: drive) not cascading Monica Computer Support 4 04-18-2004 09:31 AM



Advertisments