zoukankan      html  css  js  c++  java
  • 背景、文本格式、

    一、

        1.背景颜色由background-color属性定义,页面的背景颜色在body选择器中使用,颜色可以是十六进制,RGB,颜色名称(英文)。

          【示例:body {background-color:#b0c4de;}】

        2.背景图像由background-image属性描述,背景图像默认平铺重复(水平或垂直平铺)显示,覆盖整个元素实体。

          【示例:body {background-image:url('paper.gif');}】

        3.background-repeat属性设置使图像不平铺(目的是让背景图像不影响文本的排版)。

          【示例:

                        body
                        {
                        background-image:url('img_tree.png');
                        background-repeat:no-repeat;
                        }

             】

             甚至是改变图像位置!

           【示例:

                        body
                        {
                        background-image:url('img_tree.png');
                        background-repeat:no-repeat;
                        background-position:right top;
                        }

             】

        4.背景的简写属性为background,属性值的顺序为:background-color,background-image,background-repeat,background-attachment,background-attachment,background-position(以上属性不需要全部使用)。

    二、

        1.文本颜色的设置与背景颜色设置一样方法,但需在style中设置。

          【示例:<style>
                        body {color:red;}
                        h1 {color:#00ff00;}
                        p.ex {color:rgb(0,0,255);}
                        </style>】

         2.text-align属性设置文本对齐方式。

          【示例:h1 {text-align:center;} p.date {text-align:right;} p.main {text-align:justify;}

         3.text-decoration属性设置或删除文本修饰。

          【示例:h1 {text-decoration:overline;} h2 {text-decoration:line-through;} h3 {text-decoration:underline;}

         4.text-transform属性设置文本转换,指定文本中的大写和小写字母。

          【示例:p.uppercase {text-transform:uppercase;} p.lowercase {text-transform:lowercase;} p.capitalize {text-transform:capitalize;}

         5.text-indent属性设置文本缩进。

          【示例:p {text-indent:50px;}

  • 相关阅读:
    201621123059《Java程序设计》第二周学习总结
    学习计划表
    201621123059《java程序设计》第一周学习总结
    C语言I作业06
    C语言I博客作业05
    C语言I博客作业04
    志勇的C语言I博客作业03
    志勇的C语言I博客作业02
    志勇的第一周作业
    pdf文件完美转换技巧分享
  • 原文地址:https://www.cnblogs.com/masker99/p/10810092.html
Copyright © 2011-2022 走看看