开发者

Extra default padding problem CSS for Firefox

开发者 https://www.devze.com 2023-04-08 12:03 出处:网络
I have that CSS for one of my elements: background: -moz-linear-gradient(top, #3B3B3B 0%, #FFFFFF 100%);

I have that CSS for one of my elements:

background: -moz-linear-gradient(top, #3B3B3B 0%, #FFFFFF 100%); 

When I i开发者_高级运维nspect it at Firebug it is like:

-moz-linear-gradient(center top , #3B3B3B 0%, #FFFFFF 100%) repeat scroll 0 0 transparent

When I look at my page it has some paddings from top left down and bottom. How can I solve it?

PS: The problem is that. I give that style into a a div as like:

<html>
...
<body>
<div id ="myDiv">
....//That div is just under the body element so includes everything.
</div>
</body>
</html>

At firefox html element is upper than that div element and if I give that style into html element I can not see the result at my div.

It works at Chrome, I get this error at Firefox.


Have you removed the margin and padding from your html, body, div elements?

Something like:

html, body{
   padding:0;
   margin:0;
}

#myDiv{
   padding:0;
   margin:0;
   background: -moz-linear-gradient(top, #3B3B3B 0%, #FFFFFF 100%);
   //OTHER STYLES 
}
0

精彩评论

暂无评论...
验证码 换一张
取 消