zoukankan      html  css  js  c++  java
  • 网页开发学习笔记七: css 伪类

    • 链接伪类
      • a:link{属性: 值;}  a{属性:值;}  效果一样
      • a:link{属性: 值}     链接的默认状态
      • a:visited{属性: 值}  链接访问之后的状态
      • a:hover{属性: 值}       鼠标放到链接上显示的状态
      • a:active{属性: 值}   链接激活的状态(鼠标按下没有松开时显示的状态)
      • :focus{属性: 值}    获取焦点
    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <style type="text/css">
    
            /*默认的状态*/
            a:link{
                color: red;        }
    
            /*访问之后的状态*/
            a:visited{
                color: green;
            }
    
            /*鼠标放在链接上面的状态*/
            a:hover{
                color: yellow;
            }
    
            /*链接激活的状态*/
            a:active{
                color: orange;
            }
    
        </style>
    </head>
    <body>
    
        <a href="#">AAAAA</a>
    
    </body>
    </html>
    • 文本修饰  text-decoration: none | underline | line-through
      • none        不要线
      • underline      要下划线
      • line-through  删除线
    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <style type="text/css">
    
            /*默认的状态*/
            a:link{
                color: red;
                text-decoration: none;
            }
    
        </style>
    </head>
    <body>
    
        <a href="#">AAAAA</a>
    
    </body>
    </html>    
    • 背景属性
      • background-color       背景颜色
      • background-image       背景图片
      • background-repeat      背景平铺 repeat | no-repeat | repeat-x | repeat-y
      • background-position    背景定位 left | right | center | top | bottom
        • 方位值只写一个的时候, 另外一个默认居中
        • 写两个方位值的时候, 顺序没有要求
        • 写两个具体值的时候, 第一个值代表水平方向, 第二个值代表垂直方向
      • background-attachment  背景是否滚动 scroll | fixed
    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <style type="text/css">
    
            .box{
                width: 300px;
                height: 500px;
                background-color: #999;
                background-image: url("1.jpg");
                background-repeat: no-repeat;
                background-position: center;
                background-attachment: fixed;
    
                background: red url("1.jpg") no-repeat bottom scroll;
            }
        </style>
    </head>
    <body>
    
        <div class="box">
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
            <p>AAAAA</p>
        </div>
    
    </body>
    </html>
  • 相关阅读:
    linux du 显示目录下的各个子目录的大小
    恢复误删的procedure
    查看oracle 启动了多久
    linunx 定位最耗资源的进程
    oracle编译 失效对象方式
    oracle查询最占用资源的查询
    Android学习笔记(三)之带有侧边索引的快速查找(跟带字母索引查找的通讯录差不多)
    ScrollView中ViewPager无法正常滑动问题
    ScrollView中ViewPager无法正常滑动问题
    Android学习笔记(二)之异步加载图片
  • 原文地址:https://www.cnblogs.com/fanxiaocong/p/6445855.html
Copyright © 2011-2022 走看看