ricardo_t Posted January 24, 2018 Share Posted January 24, 2018 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; Link to comment Share on other sites More sharing options...
dsonesuk Posted January 24, 2018 Share Posted January 24, 2018 You know the html code as well makes a of a lot more difference than a image does. Link to comment Share on other sites More sharing options...
ricardo_t Posted January 24, 2018 Author Share Posted January 24, 2018 that means? Link to comment Share on other sites More sharing options...
dsonesuk Posted January 24, 2018 Share Posted January 24, 2018 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. Link to comment Share on other sites More sharing options...
Ingolme Posted January 24, 2018 Share Posted January 24, 2018 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 comment Share on other sites More sharing options...
ricardo_t Posted January 24, 2018 Author Share Posted January 24, 2018 Thank you!! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now