Jump to content

Center Alignement


Recommended Posts

Hi Guys

I'm doing my first website. Now im facing my first problem. I have a div width: 960px and in the banner i set the image also to 960px. but the div is larger than the image. (see image)

Can anyone Help?

Thanks

best regards

 

Ricardo

 

Here the css....marked Red.

 

#content{
        display: block;
        float: left;
        margin: 15px 0px 10px 0px;
        width: 960px;
        height: auto;
        background: #fff;
        padding: 15px;
        border-radius: 10px;
        border: 6px solid #1C478E;
}

#content img.float{
        float: left;
        margin: 0px;
}

#header{
        height: 85px;
        width: 960px;
}

#header img.banner_size{
        width: 960px;
}

#navigation{
        display: block;
        float: left;

1.jpg

Link to post
Share on other sites

The padding and border are added on to the base width of 960 pixels, meaning that the actual width of the box is 960 + 15 + 15 + 6 + 6, which is 1002.

That's explained with the box model https://www.w3schools.com/css/css_boxmodel.asp

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...