This is a discussion on "A realy simple question about CSS" within the Web Page Design section. This forum, and the thread "A realy simple question about CSS are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
A realy simple question about CSS
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
A realy simple question about CSS
I would like to know how i can give all my paragraphs a style by declarting it once on the first paragraph
At the moment I use something like <p class="style1">and some text here</p> <p class="style1">and some more text here</p> <p class="style1">and yet some more test here</p> This looks messy so would like to know how i can have the other <p> elements inherit the style of the first <p> |
|
|
|
#2
|
||||
|
||||
|
Re: A realy simple question about CSS
If they're in, say <div class="style1">, this CSS will do the trick:
|
|
#3
|
|||
|
|||
|
Re: A realy simple question about CSS
Oh good question.....
|
|
#4
|
|||
|
|||
|
Re: A realy simple question about CSS
Well one way would be to have the paragraphs contained in a div or something (Like Ryan said) then you could just do
#foo p {} and all paragraphs contained within #foo would inherit that style. Alternately you can delcare a style for all paragraphs everywhere with p {}. Or if you want to use "style1" something like p.style1 {} would do.
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
|
![]() |
| Tags |
| css |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| simple question | Daniel | Web Page Design | 29 | Feb 6th, 2007 17:23 |
| Simple CSS Question | welshie | Web Page Design | 9 | Jan 31st, 2007 12:22 |
| a simple question (I think) | Colm Osiris | Web Page Design | 2 | Feb 5th, 2006 09:17 |