473,324 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Basic Questions about Ruleset Sequence

1. Does it make any different what sequence I use to specify my rulesets?
For instance, is there a problem with specifying the rules for "p.footer"
before I have specified the rule for "p" or if I specify "p" before "body"?

2. What happens if I have multiple rulesets for the same selector? For
instance, if I specify
p {font-size: large} on one line of my stylesheet and then (inadvertently)
as p {font-size: small} further down, will the CSS validate and, if it does,
which will take precedence: the earliest definition or the last definition?

--
Rhio
Oct 1 '07 #1
2 1521
rhino wrote:
>
Okay, sounds like I need to learn the rules behind cascading. It is not
apparently as simple as "the last definition wins". Can you point me to a
good reference or tutorial on the subject? Something that is in clear
English, if possible. I don't want to have to take a degree in advanced
mathematics before I can understand the rules.
<http://www.w3.org/TR/CSS21/cascade.html#cascade>

--
Gus
Oct 2 '07 #2
On 2 Oct, 06:49, "rhino" <No.offline.contact.ple...@anonymous.com>
wrote:
Okay, sounds like I need to learn the rules behind cascading. It is not
apparently as simple as "the last definition wins". Can you point me to a
good reference or tutorial on the subject?
The W3C site itself (CSS 2.1).

Pay attention very carefully early on to the definitions of terms like
"rule" and "block". Then watch the _scope_ of what you're calculating
specificity on (i.e. does it apply to a rule or a block?) - that's
probably the most common misunderstanding.

If you make the deliberate effort to actually read the spec, and write
some demonstration examples to check what you're learning, then you
can learn this stuff easily enough (in a few mugfuls of coffee). The
trouble is that few people bother to make any actual effort at all.

Oct 2 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Steven O. | last post by:
First, this may not be the correct newsgroup. I have some relatively basic questions on SQL. I tried to find a newsgroup that was specifically just about SQL, and was surprised to find that all...
0
by: Ray Tayek | last post by:
hi, trying to convert some csv files into xsml and pulling a few hairs out :(. using the files below. a java program will parse the csv and take care of strange names and notes that line breaks in...
28
by: Dave | last post by:
Below is the code ive written just to count the characters typed in. I assumed EOF is -1, so if i type -1 and then press enter shouldnt the program end? It orks if i put something like 'q' in the...
4
by: Ramesh | last post by:
hi, Let me ask some basic questions. Can anybody explain me about the following questions: 1. When we have to create sn key? Whenever we compiled Component we have to create or it is a one time...
18
by: Ann Scharpf via AccessMonster.com | last post by:
I am not sure which would be the best place to post this question, so I'm posing it here with Access general questions. I have reached the point many times in Word and in Access where my ignorance...
97
by: Master Programmer | last post by:
An friend insider told me that VB is to be killled off within 18 months. I guess this makes sence now that C# is here. I believe it and am actualy surprised they ever even included it in VS 2003 in...
23
by: sophia.agnes | last post by:
Dear all, I was going through a C book written by an indian author the following are the questions given in that book 1) consider the following statement: s1 : an operator may require an...
77
by: Hans Schneider | last post by:
1. in the prg bellow what vars are stored on stack, heap, data segment? int i; void main() { int j; int *k = (void *)malloc(1); }
10
by: gouqizi.lvcha | last post by:
Hi Friends, I saw a usage of macro like #define B3 "\xA\xB\xC" I don't understand why B3 is digital 10, can ayone point what the logic behind this usage. Rick
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.