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.



 Subscribe in a reader

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

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Dec 5th, 2006, 23:19
Highly Reputable Member
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>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Dec 5th, 2006, 23:24
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
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;
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Dec 6th, 2006, 00:03
Elite Veteran
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.....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Dec 6th, 2006, 16:01
Elite Veteran
Join Date: Aug 2005
Location: That Place
Posts: 2,044
Blog Entries: 1
Thanks: 0
Thanked 37 Times in 37 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.
__________________

Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
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 Web Page Design 2 Feb 5th, 2006 09:17


All times are GMT. The time now is 20:36.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization 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