Skip navigation
kathyehmann
Currently Being Moderated

Dreamweaver pics overhanging divs

Apr 4, 2012 7:03 PM

Tags: #dreamweaver
Hi.  I am creating a website in Dreamweaver for the first time and all is going pretty well.  However, I have a banner div in which I havev placed an image (a different one for each page, so an editable area in the template) and the pics will not be constrained by the div.  All elements align on the left, but hang over on the right - even though the div and the image are both 900px wide.  I'd really appreciate some help.

 

The css code:

#outer{
width:950px;
margin:0 auto;
background-color:#FFC;

}

 

#wrapper{
width:900px;
margin:20px auto;
background-color:#FFC;

}

 

#banner {  }

 

 

The html code:

 

<body>

<div id="outer">

<div id="wrapper">

       <div id="banner">

        <img src="images/horse.gif"/>

    </div>

   

</div>

</div>

       

</body>

 

 

and this is what it looks like:

 

 

any help much appreciated.  thanks kathy

 
Replies
  • Currently Being Moderated
    Apr 5, 2012 12:09 AM   in reply to kathyehmann

    Check the width of the image youre inserting into the banner <div>or specify the width in the code:

     

     

    <img src="images/horse.gif" width="900" alt=""/>

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 5, 2012 3:29 AM   in reply to kathyehmann

    Your original code works perfectly I've tested it, so unless the images exceed 900px then you're not disclosing everything. IF this is the only code on the page it works (see below). However if you have more code and more css on the page then we will need to see it to discover what is causing your problem. Can you post a link to the page?

     

     

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

    <title>Untitled Document</title>

    <style>

    #outer {

        width: 940px;

        margin: 0 auto;

        background-color: #ffc;

    }

    #wrapper {

        width: 900px;

        margin: 20px auto;

        background-color: #ffc;

    }

    </style>

    </head>

    <body>

    <div id="outer">

    <div id="wrapper">

    <div id="banner"> <img src="images/horse.gif" width="900" alt=""/> </div>

    </div>

    </div>

    </body>

    </html>

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 6, 2012 1:35 AM   in reply to kathyehmann

    I see the problem now I have the whole picture infront of me.. You're using a css reset and asking that 10 px margin be applied around all images on your site (see below).

     

    I would never advise using a css reset unless you absolutely know what you are doing. As you have experienced this can throw your whole page out.

     

    Personally I'd get rid of the css reset OR as I have done comment it out using /*  */ (see below) also comment out the 10px margin you have asked to be applied to all your images (see below)

     

    Reset your image to 900px wide and then your page will work as expected.

     

     

     

    /* div, span, article, aside, footer, header, hgroup, nav, section,

    h1, h2, h3, h4, h11, p, blockquote, a, ol, ul, li,

    table, tr, th, td, tbody, tfoot, thead  {

    margin:10px;

    padding:0;

      border:0;

    vertical-align:baseline;

    background:transparent;  

    }*/

     

     

     

    /*img    {

    margin:10px;

    padding:0;

    border:0;  

    }*/

     
    |
    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