Gap Between to div tag-PLEASE HELP

This is a discussion on "Gap Between to div tag-PLEASE HELP" within the Web Page Design section. This forum, and the thread "Gap Between to div tag-PLEASE HELP 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 Jul 12th, 2007, 14:05
New Member
Join Date: Jul 2007
Location: Coventry
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Question Gap Between to div tag-PLEASE HELP

I have finally started to play with css as apposed to tables in html but I cannot figure out why when i have one box under another formed by div tags there is a gap.

can anyone help please? i have included the html and css code below

Code: Select all
 <html>
  <head>
  </head>
  <body>
   <div id="top">
    Top Box
   </div>
   <div id="bottom">
    Bottom Box
    </div>
  </body>
 </html>


Code: Select all
#top{
background-color:yellow;
margin:0px;
padding;0px;
}
#bottom{
margin:0px;
padding:0px;
background-color:green;
}
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 Jul 12th, 2007, 14:10
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Gap Between to div tag-PLEASE HELP

Let's play "Spot the error"
Code: Select all
#top{
background-color:yellow;
margin:0px;
padding;0px;
}
also ... you don't need to add units to 0 values. 0 is 0 in everything
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 Jul 12th, 2007, 14:21
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Gap Between to div tag-PLEASE HELP

Oooo.... I see it!!

Change the semi colon to colon!
padding: 0

What do I win?
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 Jul 12th, 2007, 14:31
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Gap Between to div tag-PLEASE HELP

Here ... have an

:rofl:
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jul 12th, 2007, 19:31
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Gap Between to div tag-PLEASE HELP

Oh yippee!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jul 12th, 2007, 19:41
Elite Veteran
Join Date: Aug 2005
Location: That Place
Posts: 2,044
Blog Entries: 1
Thanks: 0
Thanked 37 Times in 37 Posts
Re: Gap Between to div tag-PLEASE HELP

:nep:
__________________

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
  #7  
Old Jul 12th, 2007, 23:41
Up'n'Coming Member
Join Date: Jul 2007
Location: France
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Gap Between to div tag-PLEASE HELP

HI, Philiph - Learning how to validate your own code is extremely useful and can save a lot of angst. Here is a link for validating your CSS (and HTML):
http://jigsaw.w3.org/css-validator/
This will likely give you an instant result with errors in your coding. It's basically professional self-help.

Hope that helps.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Jul 12th, 2007, 23:57
Most Reputable Member
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Gap Between to div tag-PLEASE HELP

Linda, are you a squirrel. If you are then I'm afraid we're going to have a falling out.

Pete.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Jul 13th, 2007, 12:36
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Gap Between to div tag-PLEASE HELP

No Pete.. I'm not a squirrel. I just like gifts of any kind!
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 div tags

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


All times are GMT. The time now is 21:55.


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