Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Simplifying CSS

by jryan (Vicar)
on Oct 30, 2002 at 01:03 UTC ( #208940=note: print w/replies, xml ) Need Help??


in reply to Simplifying CSS

Shouldn't the simplified sheet be:
P, TD { text-align: left; } TD { font-family: sans; font-size: 12pt; } P { width: 80%; }

Also, how does the script handle:

Sheet 1:

P { text-align: left; }

Sheet2

P { text-align: center; }

Replies are listed 'Best First'.
Re: Re: Simplifying CSS
by BigLug (Chaplain) on Oct 30, 2002 at 04:53 UTC
    Firstly, no. Sheet 1 defines P as having 'font-family: sans' and 'font-size: 12pt', then sheet two defines TD as having the same. In your example, only TD gets these attributes.

    Secondly, the script's comments tell you (as does the C for Cascading) that any later definition overrides the earlier ones. Something PerlMonk's code takes advantage of. Thus in your example, the script would return 'text-align: center'.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://208940]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2021-11-30 22:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?