473,544 Members | 1,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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?

Oct 1 '07 #1
2 1533
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#ca scade>

Oct 2 '07 #2
On 2 Oct, 06:49, "rhino" <No.offline.con tact.ple...@ano nymous.com>
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 misunderstandin g.

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

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 the SQL-related newsgroups seem to be product related. But if I missed something, and someone can steer me to a correct newsgroup, please do so. ...
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 them. eventiually i want to generate the xslt from a xml file (all the files and java code are at http://tayek.com/~ray/spy1/). the java code...
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 while loop to end the loop. what is up? <code> #include <stdio.h>
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 process? 2. What information contained in sn key. I gone through that it is having public key. How it is using this key to intract with client....
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 of VBA is a real detriment to me. I saw some posts about VBA classes with a particular vendor and the poster was advised not to take the class...
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 the first place. Anyone else heard about this development? The Master
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 lvalue operand, yet yield an r value s2: an operator may accept an rvalue operand , yet gives an lvalue
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); }
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
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.