CASCADING style sheets

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
9902468
Forum Commoner
Posts: 89
Joined: Thu Jun 06, 2002 6:39 am
Location: Europe

CASCADING style sheets

Post by 9902468 »

Just checking, before I plan more...

1. Include one css file

Code: Select all

p {
     color: black;
     text-decoration: underline;
}

2. Include second css file

Code: Select all

p {
     color: red;
}

The color is red, no? Latest introduced class overrides previously introduced ones. However are, in my example, the p underlined? Eg. is there inheritance? How well browsers handle this?

Thanks,

-99
Nay
Forum Regular
Posts: 951
Joined: Fri Jun 20, 2003 11:03 am
Location: Brisbane, Australia

Post by Nay »

I'm not sure what you want but yes, the P will be underlined and in red color. Why would you want to do it in the first place. I won't validate as valid CSS (since I like my CSS to be valid) - you'll get a "redefined" error if I'm not mistaken.

-Nay
creditwrench
Forum Newbie
Posts: 3
Joined: Tue Aug 26, 2003 4:11 pm
Location: Oklahoma City, Ok

help with css

Post by creditwrench »

I'm useing Dreamweaver and it has css capability of course but I just can't seem to get a handle on how css works or how to build style sheets or anything else.

I've tried several on line tutorials and still can't make any sense out of it.
Maybe I'm educationally handicapped or something but I can usually learn most things pretty fast if I can just see the overall scheme of things first so I know what the end result should be. Once I kow what the end result should look like and get a handle on the command set I can pretty well make things work.

I'm using frames on my website right now and that isn't getting me a lot of good comments or rave reviews to say the least.

What I want to accomplish is to keep my link list on the left side and the banner at the top and then have my main content all down the right side.

I've tried to use tables to get the job done and can't make them work properly either.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Overriding could in fact be useful if you have a defined p style, then want to overide attributes here and there, eg by:

<p style="color: #fff;">new colour here: other paragrapsh not affected</p>

In reverse order of precedence:

stylesheet
styles defined in document <head>
attributes defined inside tags

AFAIK inheritance doesn't pose any problems - at least with newer browsers.

Worth a look for some CSS tips:

http://www.alistapart.com/stories/
http://www.glish.com/css/
http://www.tantek.com/CSS/Examples/boxmodelhack.html
Post Reply