Reputation: 456
On a page that I am currently working on, I have come across an error. When you view the page on desktop on certain computers, the header is perfectly fine with 100% width, but the footer needs extra width to be the full page width. Also, on some other computers, even adding the extra width doesn't work. These end up with a bit of space on the right side.
Any help would be greatly appreciated.
Upvotes: 0
Views: 176
Reputation: 475
Different browsers set different default CSS rules. Try including a reset.css or a normalise.css (Google for either one or for "reset vs normalise" to see the differences) to remove those defaults.
User agent style sheets are overridden by anything that you set in your own style sheet.So,here in your webpage body is set with margin.So,we have to explicitly add following code in css.
CSS
body{
margin:0
}
Upvotes: 1
Reputation: 1812
Add margin 0 on body
:
body {
margin: 0;
}
Remove extra width from .foot
.foot {
position: relative;
background-color: rgb(41, 41, 41);
margin-top: 50px;
height: 100px;
/* width: 100.8744%; */
/* bottom: -8px; */
/* left: -8px; */
}
Upvotes: 1
Reputation: 2071
You have multiple problems in your code.
Do this;
body {
margin: 0;
}
footer {
margin-top: 50px;
background-color: rgb(41, 41, 41);
}
.foot {
position: relative;
height: 100px;
}
Upvotes: 2