Skip navigation
Currently Being Moderated

White space between Div Tags

Dec 28, 2012 11:57 AM

I'm using DW CS4.  I need help decreasing the white space between div tags.  I want to make the white space between the grey line and my nav bar smaller.  I can't see any places where there are margins or padding.  Can someone help?  Here is the code.  thanks.


<body bgcolor="#CCCCCC" onload="MM_preloadImages('../_img/HOMEover.jpg','../_img/COMPANYover. jpg','../_img/PROJECTSover.jpg','../_img/CASE STUDIESover.jpg','../_img/CONTACTUSover.jpg')">

<div id="container">

  <div align="left">

    <p><img src="../_img/Nute_Logo_tag_060612.gif" alt="logo" name="logo" width="113" height="74" hspace="5" align="absbottom" id="logo" /></p>


  <div id="header"></div>

  <div id="main content"></p>

    <table border="0" cellpadding="0" cellspacing="0">


        <td><a href="javascript:;" target="_top" onclick="MM_nbGroup('down','group1','bluebar','',1)" onmouseover="MM_nbGroup('over','bluebar','','',1)" onmouseout="MM_nbGroup('out')"><img src="../_img/bluebarup.jpg" alt="" name="bluebar" width="118" height="15" border="0" id="bluebar" onload="" /></a></td>

        <td><a href="javascript:;" target="_top" onclick="MM_nbGroup('down','group1','home','',1)" onmouseover="MM_nbGroup('over','home','../_img/HOMEover.jpg','',1)" onmouseout="MM_nbGroup('out')"><img src="../_img/HOMEup.jpg" alt="Click HOME to go to the home page" name="home" width="115" height="15" border="0" id="home" onload="" /></a></td>

        <td><a href="javascript:;" target="_top" onclick="MM_nbGroup('down','group1','company','',1)" onmouseover="MM_nbGroup('over','company','../_img/COMPANYover.jpg','' ,1)" onmouseout="MM_nbGroup('out')"><img src="../_img/COMPANYup.jpg" alt="Click COMPANY to go to our services" name="company" width="122" height="15" border="0" id="company" onload="" /></a></td>

        <td><a href="javascript:;" target="_top" onclick="MM_nbGroup('down','group1','projects','',1)" onmouseover="MM_nbGroup('over','projects','../_img/PROJECTSover.jpg', '',1)" onmouseout="MM_nbGroup('out')"><img src="../_img/PROJECTSup.jpg" alt="Click PROJECTS to view our projects" name="projects" width="122" height="15" border="0" id="projects" onload="" /></a></td>

        <td><a href="javascript:;" target="_top" onclick="MM_nbGroup('down','group1','casestudies','',1)" onmouseover="MM_nbGroup('over','casestudies','../_img/CASE STUDIESover.jpg','',1)" onmouseout="MM_nbGroup('out')"><img src="../_img/CASE STUDIESup.jpg" alt="Click CASE STUDIES to see sample projects" name="casestudies" width="150" height="15" border="0" id="casestudies" onload="" /></a></td>

        <td><a href="javascript:;" target="_top" onclick="MM_nbGroup('down','group1','contactus','',1)" onmouseover="MM_nbGroup('over','contactus','../_img/CONTACTUSover.jpg ','',1)" onmouseout="MM_nbGroup('out')"><img name="contactus" src="../_img/CONTACTUSup.jpg" border="0" alt="" onload="" /></a></td>


    </table><img src="" alt="" name="mainphoto1" width="780" height="264" id="mainphoto1" />



  • Currently Being Moderated
    Dec 28, 2012 12:12 PM   in reply to bdab

    All browsers add default margins and padding (spaces) to every html element.  If you want to shore up the spaces between elements, apply margin:0; padding:0 to all elements individually or incorporate a CSS Reset method into your site.


    PS. Validate your code & fix reported errors.


    Code Validation Tools


    CSS -

    HTML -



    Nancy O.

    Mark as:
  • Currently Being Moderated
    Dec 28, 2012 12:19 PM   in reply to Nancy O.

    I think the space you're trying to kill is being caused by the <p> tags wrapped around your image at...


    <img src="../_img/Nute_Logo_tag_060612.gif" alt="logo" name="logo" width="113" height="74" hspace="5" align="absbottom" id="logo" />


    If you had a functioning page online that you could provide the link to, it would be much easier to decipher what you are trying to do though.

    Mark as:
  • Currently Being Moderated
    Dec 31, 2012 9:40 AM   in reply to bdab

    You can't post images via email, you'll need to come to the forum to attach images so we can take a look.

    Mark as:
  • Currently Being Moderated
    Dec 31, 2012 10:09 AM   in reply to bdab

    From the web forum, use the camera icon to insert an image into your message. 

    Or better still, post the URL to your test page so we can see it in our browsers.



    Nancy O.

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points