zoukankan      html  css  js  c++  java
  • 父元素遮住子元素的问题

    这是一种样式实现方法,可能存在问题,做个笔记方便以后看

    为两部分,第一部分橘色是parent,蓝色是children

    hover时候,children出现 

    效果图:

    原理实现 :

    .header .gwc{
        margin-right: 98px;
        background-color: #fff;
        float: right;
        margin-top: -60px;
        border: 1px solid #e3e4e5;
        color: #f10215;
        line-height: 35px;
        text-align: center;
        font-size: 12px;
         190px;
        position: relative;
    } 
    .header .gwc:hover{
        border-color:#ccc;
        border-bottom: 2px solid #fff;
    用白色的变遮住下面子元素灰色的边,实现不规则图形描边
    }

      子元素:

    .header .gwc:hover .gwc_box{
        display: block;
    }
    .header .gwc_box{
        display: none;
        position: absolute;
         310px;
        height: 70px;
        border: 1px solid #ccc;
        bottom: -70px;
        right: -1px;
        box-sizing: border-box;
        padding: 10px;
        z-index:-1;必须为负值 父级元素才会显现上来
        background-color: #fff;
    }
    

      这样就完成了 

    hover 

  • 相关阅读:
    局域网中电脑之间无法ping通问题
    Python 字典dict操作定义
    set集合
    Python 元组遍历排序操作方法
    Python List 列表list()方法
    set函数&操作
    dict函数
    文件操作
    list函数
    字符串格式化format使用
  • 原文地址:https://www.cnblogs.com/GoTing/p/7225965.html
Copyright © 2011-2022 走看看