zoukankan      html  css  js  c++  java
  • css 常用语法

    1、禁止某个元素内的任何选中操作:

    .classname{
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }

    2、移动端禁止屏幕滚动css:

    这个是在移动端某个固定区域需要滑动时,要禁止掉系统自带的滑动效果

    说是要同时设定两个才会有效,但是我只给html设定了一个hidden属性也能正常达到效果、不知道会不会有隐藏问题

    html,body{
      overflow: hidden;
      height: 100%;
    }

    元素限高滚动:

    设定元素 overflow-y、高度,即可滚动

    .floorplanlist {
      height: 800px;
      overflow-y: scroll;
    
    }

    元素漂浮:

    设定属性position、z-index .再控制元素展示位置

    .floating {
      position: fixed;
      z-index: 100 !important;
    }
    .dsds {
       300px;
      right: 20px;
      bottom: 105px;
    }

    相对父级元素漂浮:

    浮动定位的话,需要注意层级关系,z-index 

    <div>
    <div>标题</div>
    </div>
    最外层div加poition=relative;
    然后标题的position为absolute就能相对于外层的div定位

    文本支撑父体高度:

    不写具体高度

    height:auto; 

    边框:

     border: #000000 dashed 3px;

    背景透明:

    使用rgba色码

    background-color: rgba(0, 0, 0, 0.3);

    动态宽高:

    使用calc,进行加减

       div{
           height: calc(100vh - 100px);     
        }
  • 相关阅读:
    14-Reverse Integer
    13.Merge k Sorted Lists
    12-Add Digits
    11-String to Integer (atoi)
    10.Power of Two-Leetcode
    9. Delete Node in a Linked List
    使用Openmp并行化
    C++编译过程与内存空间
    C++栈溢出
    程序(进程)内存空间分布深入理解
  • 原文地址:https://www.cnblogs.com/yc-c/p/13101062.html
Copyright © 2011-2022 走看看