日期:2014-05-16  浏览次数:20589 次

css图片定位,注释(定义摘录)

?

<div class="goleft"><a href="#">上一张</a></div>
<div class="goright"><a href="#">下一张</a></div>

?

.gundong .goleft{ width:35px; height:80px; background:url(../images/minjt.gif) 0 0 no-repeat; text-indent:-999px;overflow:hidden; position:absolute; left:-35px;top:300px;}
.gundong .goright{ width:35px; height:80px; background:url(../images/minjt.gif) 0 -100px no-repeat; text-indent:-999px;overflow:hidden; position:absolute; left:1000px;top:300px;}

?1.width

定义和用法

width 属性设置元素的宽度。

说明

这个属性定义元素内容区的宽度,在内容区外面可以增加内边距、边框和外边距。

?

2.background

定义和用法

background 简写属性在一个声明中设置所有的背景属性。

可以设置如下属性:

  • background-color
  • background-position
  • background-size
  • background-repeat
  • background-origin
  • background-clip
  • background-attachment
  • background-image

如果不设置其中的某个值,也不会出问题,比如 background:#ff0000 url('smiley.gif'); 也是允许的。

通常建议使用这个属性,而不是分别使用单个属性,因为这个属性在较老的浏览器中能够得到更好的支持,而且需要键入的字母也更少。

?

实例

如何在一个声明中设置所有背景属性:

body
  { 
  background: #00FF00 url(bgimage.gif) no-repeat fixed top;
  }

?

3.text-indent

定义

text-indent 属性规定文本块中首行文本的缩进。

注释:允许使用负值。如果使用负值,那么首行会被缩进到左边。