首页 > Web开发 > 详细

css样式属性

时间:2017-10-10 15:31:09      阅读:283      评论:0      收藏:0      [点我收藏+]

1、背景

background-color:背景色

 <div style="width:50px; height:50px; background-color:#F00;">

技术分享

background-image:背景图

<body>
   <div style="width:100px; height:100px; background-color:#6C3; background-image:url(lx1.png);">
    gyvgvgv
     </div>
</body>

技术分享

background-repeat:no-repeat不平铺;repeat平铺;repeat-x横向平铺;repeat-y纵向平铺

<body>
    <div style="width:100px; height:100px; background-color:#6C3; background-image:url(lx1.png); background-repeat:no-repeat">
    <!--no-repeat不平铺;repeat平铺;repeat-x横向平铺;repeat-y纵向平铺-->
     </div>
</body>

技术分享

background-position:调整背景图片位置(repeat:no-repeat);center居中;

<body>
    <div style="width:100px; height:100px; background-color:#6C3; background-image:url(lx1.png); background-repeat:no-repeat; background-position:center">
     </div>
</body>

技术分享

background-position当设置左右必须有上下位置才起作用

<body>
    <div style="width:100px; height:100px; background-color:#6C3; background-image:url(lx1.png); background-repeat:no-repeat; background-position:left 10px top 10px">
     </div>
</body>技术分享

技术分享

 

css样式属性

原文:http://www.cnblogs.com/navyouth/p/7645345.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!