zoukankan      html  css  js  c++  java
  • 伪类选择器,浮动

        /* 应用于所有元素,一般来写取消外边距和内边距 优先权低于元素选择器*/
        *{
            margin: 0px;
            /* padding: 0px; */
           /* color: pink; */
        }
        /* 无序列表修改前面的样式 */
        .aa{
            list-style-type:none;
            /* list-style-image: url(../ujx.jpg); */
            padding-left: 10px;
            background: url(../ujx.jpg) no-repeat left;
            background-size: 10px;
        }
        /* 表格合并边框 */
        .tt{
             300px;
            border-collapse:collapse;
            table-layout:fixed;  写好后在td里写overflow-x: scroll; 内容过多后出现滚动条
        }
        /* 表格内容超出后显示滚动条 */
        .td{
            overflow-x: scroll;
        }
        /* 浮动 */
        .fl{
            float:left;
        }
            /* 清除浮动 */
        .a::after{
            display:block;
            content:" ";
            clear:both;
        }
        /* 或者是在父级元素下加 */
        <div style="clear:both"></div>
        /* 选择器分组 */
        div,p{
            color:red
        }
        /* 后代选择器在父类元素内都生效*/
        div a{
            color: pink;
        }
        /* 子类选择器必须在父类的下一级 */
        div>p{
            color: plum;
        }
        /* 相邻兄弟选择器 */
        div+p{
            color: rgb(238, 231, 231);
        }
        /* 伪类选择器 */
            /* 没有被访问 */
        a:link{
            color: royalblue;
        }
            /* 访问后样式 */
        a:visited{
            color: saddlebrown;
        }
            /* 鼠标移动到上面的效果 */
        a:hover{
            color: red;
        }
            /* 点击时候的样式 */
        a:active{
            color: seagreen;
        }
        /* 其他标签加样式 */
        span:hover{
            color: seashell;
        }
        span:before{
            content: "元素前加内容可以用作引入图片";
        }
        span::after{
            content: '元素后加内容';
        }
      
  • 相关阅读:
    preg_match 截取长度限制
    上传文件过大的问题
    PHP的线程安全ZTS与非线程(NTS)安全版本的区别
    开篇
    node:3416) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
    如何达到最最简单的平滑滚动
    react 复习
    包管理器
    github-443
    记录一下经常忘的数组方法,栈和队列
  • 原文地址:https://www.cnblogs.com/sheep-fu/p/12720514.html
Copyright © 2011-2022 走看看