Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
<div> default spacing
Old 12-18-2006, 11:09 PM <div> default spacing
Super Talker

Posts: 144
Name: Nick Mallare
Location: Olathe, KS
Trades: 0
Live example: Here.

The <div> element gives the default spacing on the top, between the top border and the <p> tag. Is there a way to reduce the inner padding of a div? I've tried both of these:

Code:
padding: 0% 0% 0% 0%;
AND

Code:
padding-top: 0%;
Nick
nmallare is offline
Reply With Quote
View Public Profile Visit nmallare's homepage!
 
 
Register now for full access!
Old 12-19-2006, 12:12 AM Re: <div> default spacing
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
The problem is you need to adjust both the <div> and the <p>. The spacing you get will be whatever is the maximum of the two so if you set the top of the div to be 0px, but the <p> has a default bottom of say 10px you still get the 10px between them.

I also think it's margins you want to change instead of the padding. You might also not want to set the margins (or paddings) for all <div>s and <p>s. It might work better to define classes that you can add to any <div>s or <p>s you want to have the new margin.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 12-19-2006, 02:43 AM Re: <div> default spacing
Super Talker

Posts: 144
Name: Nick Mallare
Location: Olathe, KS
Trades: 0
Quote:
Originally Posted by vangogh View Post
I also think it's margins you want to change instead of the padding.
Set the margin of the "Registration Error" <p> as follows, and it worked great! Thank you very much.

Code:
margin-top: 0%;
Nick
nmallare is offline
Reply With Quote
View Public Profile Visit nmallare's homepage!
 
Old 12-19-2006, 03:08 PM Re: <div> default spacing
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Glad to help. The same thing kept me confused for a long time until I came across how it worked.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Reply     « Reply to <div> default spacing
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.14462 seconds with 12 queries