zoukankan      html  css  js  c++  java
  • css基础-Background&Text

    css基础-Background&Text

        以下笔记为复习css的一些基础,每一节我都做了一个简单的总结事例,以便参考:

     1 /*CSS 属性定义背影效果:
     2 
     3     background-color 定义了元素的背景颜色.
     4     background-image 定义了元素的背景图像.
     5     background-repeat 定义是否重复
     6     background-attachment 背景图像是否固定或者随着页面的其余部分滚动
     7     background-position  改变图像在背景中的位置
     8 */
     9 
    10 body{
    11    width:200px;
    12    height:200px;
    13    background-color:#b0c4de;
    14    background-image:url(img.png);
    15    background-repeat:no-repeat;/*repeat-x,repeat-y*/
    16    background-attachment:fixed;/*固定不动*/
    17    /*scroll     背景图片随页面的其余部分滚动。这是默认
    18      fixed     背景图像是固定的
    19      inherit     指定background-attachment的设置应该从父元素继承*/
    20    background-position:top center;
    21 
    22 }
    23 
    24 /*简写*/
    25 body{
    26     width:200px;
    27     height:200px;
    28     background:url(img,png) no-repeat fixed top center;
    29 }
    30 
    31 
    32 /*文本格式
    33 text-align:center left rifht justify(左右对齐);
    34 text-decoration:none  overline(上边一横线)  line-through(中间一横线) underline;
    35 文本转换
    36    text-transform:uppercase(全为大写) lowercase(全为小写) capitalize(每个字的首字母大写);
    37 文本缩进
    38    text-indent:50px;首行缩进50px
    39 字间距
    40    word-spacing:30px;
    41 文字方向
    42   direction:ltr;  left to right
    43 字母间距
    44  letter-spacing:1px;
    45  行高
    46   line-height:30px;
    47 */
    48 p{
    49     width:200px;
    50     height:300px;
    51     margin:0;
    52     padding:0;
    53     text-align: center;
    54     text-decoration: underline;
    55     text-indent: 10px;
    56     word-spacing: 5px;
    57     letter-spacing:2px;
    58     line-height: 20px;
    59     direction: ltr;
    60     text-transform: capitalize;
    61 }
  • 相关阅读:
    Maven跳过测试
    Maven教程
    使用订单号加锁
    SpringMVC重定向路径中带中文参数
    并发文章
    maven clean插件使用进阶
    线程池基础
    Session中短信验证码设置有效时间
    Linux命令
    下载并安装Cent OS 6.5
  • 原文地址:https://www.cnblogs.com/Terminaling/p/4067458.html
Copyright © 2011-2022 走看看