好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

为什么用div设置背景的时候左边和上面会有1像素的空白?_html/css_WEB-ITnose

不知道怎么回事,在div里面设置背景后背景会有1个像素的空白
.container {	display: block;	float: left;	background:url(images/body-bg.jpg) no-repeat;	margin: 0px;	width: 100%;	height: 100%;	position: fixed;	} 


回复讨论(解决方案)

body{padding:0px;margin:0px;}

*{paddinf:0px;margin:0px;}

因为bady的margin的值默认是2px; 所以要在CSS里面声明body{padding:0px;margin:0px;}

原来是这样啊...谢谢

查看更多关于为什么用div设置背景的时候左边和上面会有1像素的空白?_html/css_WEB-ITnose的详细内容...

  阅读:32次