微信二维码
微博二维码
qq号二维码

【css】清除定位如何书写css?

夏磊银 2020-09-10 WEB前端 119人浏览
当一个元素存在定位position:relative;时想要悬停触发清除定位应该如何书写?
6个回答
李永春
追加类名 a。position:static
  2020-09-10
张凯
position:static;默认值。没有定位,元素出现在正常的流中(忽略 top, bottom, left, right 或者 z-index 声明)。
  2020-09-10
李子行
.content:hover{
position:static;
/* static 是默认值。表示没有定位,或者说不算具有定位属性。元素出现在正常的流中(忽略 top, bottom, left, right 或者 z-index 声明)。*/
}
  2020-09-10
黄庆峰
position:static 静态定位 静态定位是元素的默认定位方式,没有定位的意思。定位的时候不使用
  2020-09-10
王聪
.jiantou{ width: 100px; height: 100px; background: darkblue; position: absolute; top: 50%; left: 0; } .jiantou:hover{ position: static; }
static(静态定位):默认值。没有定位,元素出现在正常的流中(忽略 top, bottom, left, right 或者 z-index 声明)。
  2020-09-10
丁凯
1. position:static; 正常文档流 2. position:unset; unset 关键字我们可以简单理解为不设置.
回答已被采纳   2020-09-10
分享到: