css day2

1.  背景

  1.1背景的不重复  background-repeat:no-repeat;

    背景的横向重复  background-repeat:repeat-x;

    背景的纵向重复  background-repeat:repeat-y;

  1.2背景固定不随滑轮滑动而消失

    background-attachment:fixed;

  1.3背景放置位置定位

    百分比定位     position:50% 50%

    定位      position:center/top/bottom...(top默认为center top,right默认为center right等)

    像素定位    position:200px 200px

    但是对于火狐来说前两种都不能正常显示,只有加position-attachment:fixed的时候才能正常显示,但是加了fixed就固定了背景,所以推荐使用像素定位

  当整张背景图片上还出现了一张背景图片的时候,第二张图片一定要加no-repeat;

  eg:  background: green url(/i/eg_bg_03.gif) no-repeat fixed center; (在绿色的背景上存在了一张gif)

 2.  文本

  2.1缩进

    1)  css  text-indent:5px;

            text-indent:-5px;  (如果是负数的话,还需要写上padding-left:xxxx; 要不然会超出浏览器的边界)

    2)  css  .tex{width:100px}

            .p{text-indent:10%}  (缩进采取百分号,一定是上一级父元素的宽度的比例)

        html   <div class="tex"><p>hello world</p></div>

  2.2输入格式

    1)  css  text-decoration:none

    2)  css  text-decoration:underline

    3)  css  text-decoration:overline

    4)  css  text-decoration:line-through

  2.3英文大小写  

    1)text-transform:none;    保持原文大小写

    2)  text-transform:uppercase;    所有字母大写

    3)  text-transform:lowercase;   所有字母小写

    4)  text-transform:capitalize;  所有单词首字母大写

posted @ 2016-03-28 16:35  swii  阅读(111)  评论(0编辑  收藏  举报