段落空两行
text-indent:2em边距有2种方法(用em也行)
外边距:
margin-left: 10px内边距
padding-left: 10pxbody{ margin:0padding:0background:url(images/bg02.png) top 0 repeat-x}这个设为左右两边伸展的背景图片
.divbg{ background:url(images/bg01.png) 0 0 no-repeat width:350pxheight:500pxmargin:0 auto}
这个是中间的图片
<body>
<div class="divbg"></div>
</body>
注:左右可伸展的图片你可以做成宽度为1px的图片,这样就可以横向平铺
<pre t="code" l="html"><!DOCTYPE html><html>
<head>
<style>
div
{
width:100px
height:100px
background:red
position:absolute
animation:myfirst 5s
-webkit-animation:myfirst 5s
animation-fill-mode: forwards
}
@-webkit-keyframes myfirst /* Safari and Chrome */
{
0% {background:redleft:500pxbottom:50px}
25% {background:redleft:500pxheight:130pxbottom:50px}
50% {background:redleft:500pxheight:160pxbottom:50px}
75% {background:redleft:500pxheight:190pxbottom:50px}
100% {background:redleft:500pxheight:210pxbottom:50px}
}
</style>
</head>
<body>
<div></div>
</body>
</html>这只是个演示的demo,方法就是这样,animation-fill-mode: forwards这一句给你解释下,这句就是当动画完成时,动画会停留在最后一帧。其他代码都比较简单,不懂随时问我。
希望能够帮助到你,!