A realy simple question about CSS

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.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Dec 5th, 2006, 23:19
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
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>
Reply With Quote

  #2 (permalink)  
Old Dec 5th, 2006, 23:24
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: A realy simple question about CSS

If they're in, say <div class="style1">, this CSS will do the trick:

Code: Select all
.style1 p {
    color: #c00;
}
Reply With Quote
  #3 (permalink)  
Old Dec 6th, 2006, 00:03
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: A realy simple question about CSS

Oh good question.....
Reply With Quote
  #4 (permalink)  
Old Dec 6th, 2006, 16:01
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,999
Blog Entries: 1
Thanks: 0
Thanked 32 Times in 32 Posts
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.
__________________
I hate IE 6. Just sayin....
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Reply With Quote
Reply

Tags
css

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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 Introduce Yourself 4 Feb 8th, 2006 20:00
a simple question (I think) Colm Osiris Web Page Design 2 Feb 5th, 2006 09:17


All times are GMT. The time now is 17:06.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43