目录:

  一、伪类

  二、样式

   1、字体

   2、背景图片

   3、margin和padding

   4、列表属性

   5、float

   6、clear

   7、position

   8、text-decoration(a标签下划线去除)

   9、vertical-align

内容:

  一、伪类

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>

        a:link{
            background-color:red;

        }
        a:hover{
            background-color:blue;
        }
        a:visited{
            background-color: #dddddd;
        }
        a:active{
            background-color:green;
        }
        p:after{
            content: 'ppp';
        }
        p:before{
            content: 'aaa';
        }
    </style>
</head>
<body>
    <!--伪类-->
    <a href="http://www.baidu.com">baidu</a>
    <p>hello p &nbsp;</p>
</body>
</html>

 

  二、样式

  1、字体格式:

    letter-spacing: 字母之间的间距

    word-spacing: 单词之间的间距(重要)

    text-transform:capitalize  首字母大写

  2、背景图片

    background-position:center center 表示居中

  3、margin和padding

  注意:在div嵌套中,如果外面的div标签没有内容,设置里面div的margin的时候,会发现左右是你想要的效果,但是上下会有问题,这个问题是div塌陷问题,通常需要在div中标注内容或者在外面div中加border解决div塌陷问题

  4、列表属性

  ul,ol{

    list-style:decimal-leading-zero;

    list-style:none;

    list-style:circle;

    list-style:upper-alpha;

    list-style:disc;

  } 

ul{
            /*list-style: decimal-leading-zero;*/ 显示数字
            /*list-style:none;*/    无任何样式
            /*list-style:circle;*/  显示为序列为空心圆
            /*list-style:upper-alpha;   显示序列为A  B   C*/
            list-style:disc; 普通显示

        }
View Code

相关文章:

  • 2021-06-20
  • 2022-12-23
  • 2021-06-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-09
  • 2022-12-23
相关资源
相似解决方案