Jump to content
ricardo_t

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

Share this post


Link to post
Share on other sites

html code that makes up your website, better than a image, as an image does not show us how the html code layout is to what the css is referring to. A link to website would be even better.

Share this post


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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×