Html 位置“初始”跨浏览器 - css

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15343487/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 06:20:04  来源:igfitidea点击:

Is position 'initial' cross-browser - css

htmlcsscross-browsercss-position

提问by epsilones

I have a css conflict, so I have to go against an absolute positioning property that deals with some class .myclass. But in one case, I want a div with .myclassclass to have a no absolute positioning. So I put position: initial, which works in Chrome, but is it cross-browser? I googled it and found nothing really precise.

我有一个 css 冲突,所以我必须反对处理某些 class 的绝对定位属性.myclass。但在一种情况下,我希望一个带有.myclassclass的 div没有绝对定位。所以我把position: initial,它在 Chrome 中工作,但它是跨浏览器的吗?我用谷歌搜索它并没有发现任何真正精确的东西。

回答by Andy

The default for position is position: static;

位置的默认值是 position: static;

回答by adrift

The initialkeyword was introduced in 2011 in the Cascading and Inheritance Module-- it's supported in FF 19+, Chrome, Safari, Opera 15+but is currently not supportedin any version of IE.

initial关键字于 2011 年在Cascading and Inheritance Module中引入——FF 19 +、Chrome、Safari、Opera 15 +支持它,但目前任何版本的 IE都不支持

回答by Simon_Weaver

Even IE 11 gives me the 'squiggles' for this one. Changing to staticgave me the desired behavior.

甚至 IE 11 也给了我这个的“squiggles”。更改为static给了我所需的行为。

enter image description here

在此处输入图片说明

Chrome actually suggests it as an acceptable property in its dropdown

Chrome实际上在其下拉列表中建议将其作为可接受的属性

enter image description here

在此处输入图片说明