希望对象从0px顶部开始,0px从左边开始,一直向右移动: http://imgur.com/A76ymUQ
我在上面展示了。 这是它的html代码和css代码:
<div id="page">
<h1 id="header"></h1>
</div>
-------------------------------------------------------------
body {
background-image:url(../img/b_webclient_1.png);
background-position: center center fixed;
background-repeat: no-repeat;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
div #header {
background-image:url(../img/webclient_header.png);
min-height: 100px;
width: auto;
margin:; /* If you want no margin */
padding:; /*if your want to padding */
background-repeat: no-repeat;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
答案 0 :(得分:1)
来自:万维网联盟的Default style sheet for HTML 4
<body>
代码的默认边距为8像素
通过将其添加到CSS来重置它:
body {
margin:0;
}
<h1>
代码的默认边距为0.67 em&#39>
通过将其添加到CSS来重置它:
h1 {
margin:0;
}