Css Spacing Help!

This is a discussion on "Css Spacing Help!" within the Web Page Design section. This forum, and the thread "Css Spacing Help! 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 Aug 13th, 2007, 09:14
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to RZX Developer
Css Spacing Help!

Hi All,

I just wanted to know whether there is a CSS property that allows you to add space to your content without using <br />? If so could you please add the code needed along with the tag?

Regards

Wayne
Reply With Quote

  #2 (permalink)  
Old Aug 13th, 2007, 09:21
1840dsgn's Avatar
SuperMember

SuperMember
Join Date: Jun 2007
Location: Canterbury
Age: 19
Posts: 720
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Css Spacing Help!

You can use the '+' symbol to space between two elements.

For example

Code: Select all
 
p+p {
 
padding-top: 2em;
 
}
would add 2em of padding everytime one paragraph directly follows another paragraph.

Similarly,

Quote:
h1+p {

padding: 15px;
color: #fff;

}
would add 15px of padding and change fpont color to white for every paragraph that directly follows an h1 tag.
Reply With Quote
  #3 (permalink)  
Old Aug 13th, 2007, 11:31
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Css Spacing Help!

What types of elements? Different elements aligned differently would require different thinking.

If it is a paragraph, I add a margin-bottom to the <p>

css
Code: Select all
p {
margin-bottom: 20 px;
}
So the html would look like this
Code: Select all
<p>I love summer time, it's such a fun time of year</p>
<p>Many people prefer Fall, since it's not quite as hot out</p>
Reply With Quote
  #4 (permalink)  
Old Aug 13th, 2007, 12:21
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Css Spacing Help!

The margin and padding properties are what you are most likely looking for.

But ... there are some instances where is it OK to use <br> ... so ... a little more info might help
Reply With Quote
  #5 (permalink)  
Old Aug 13th, 2007, 12:24
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to RZX Developer
Re: Css Spacing Help!

I am wanting this to seperate paragraphs, so the above example have worked really well!
Reply With Quote
  #6 (permalink)  
Old Aug 13th, 2007, 12:26
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Css Spacing Help!

Great!
Reply With Quote
Reply

Tags
css spacing help

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
Help needed with Spacing hbb Web Page Design 9 Jun 12th, 2007 16:22
Spacing paragraphs polkadot Starting Out 3 May 25th, 2007 12:48
div spacing johnnybravo Web Page Design 13 Sep 6th, 2006 12:06
Image Spacing! Help! djcee Web Page Design 6 Aug 9th, 2006 11:59
spacing around images AdRock Web Page Design 4 Aug 2nd, 2006 21:32


All times are GMT. The time now is 16:13.


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