- 博客(2)
- 收藏
- 关注
原创 js中获取css中的样式方法:style,currentStyle,getComputedStyle
用js来获取或者设置css相关样式,是很常见的需求,下面将对比一下js中的各个方法; 1,style var obj = document.getElementById('box'); console.log(obj.style.width); obj.style.width = '50px'; ele.style[attr] ele.style.attr ...
2019-07-11 16:05:26
267
原创 实现导航栏部分重叠的效果
类似这种: 实现思路: 1,外层div设置相对定位 { display: relative; } 2,里面每一个标签设置绝对定位,并设置z-index,根据需求,设置位置,使其互相重叠 display: absolute; z-index: 1; 3,给激活的标签加一个类名:active,单独设置这个类的样式,并设置层级要高一级 z-index: 2; ...
2019-07-04 16:25:16
992
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人