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);
}