css控制某个div固定不动 |
您所在的位置:网站首页 › 纸质闹钟指针怎么固定不动 › css控制某个div固定不动 |
固定最常用的方法就是对其进行定位。 但在定位的时候需要注意: ①如果想固定在屏幕的某处,那么确定被固定的元素的父元素是body; ②为固定元素设置宽高。 比如给你的footer的class添加如下代码: .shopping_cart { position: fixed; left: 0; bottom: 0; width: 100%; height: 60px; background: #eee; z-index: 10; }如顶部固定不动 .editFrom { ----div的选择器 position: fixed; ----position样式 left: 0; top: 0; width: 100%; height: 30%; ---div占用位置的高度 background: #eee; z-index: 10;--折叠级别 }
|
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |