2017-07-21 06:20
采纳率: 0%
浏览 3.0k

css 中使用太多的position会有不好的影响吗?


  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

6条回答 默认 最新

  • q975583865
    一点寒芒先至 2017-07-21 06:22


    点赞 评论
  • huang931027
    IAmObject 2017-07-21 06:38

    position不会啊,就是一个定位,现在的话一般都会用 position:absolute; 相对定位。position一会保证元素在一个相对固定的位置。经常还会和z-index一块用的。
    我的感觉的话,position 是在布局上比较重要的一个配置,只要理解这个东西,就不会觉得它会有不好的影响。
    兄弟相信我,不是我吹牛,我对这些东西真的很精的 — —

    点赞 评论
  • u012743772
    C恒一 2017-07-21 06:38

    Browser compatibility

    [1] Since Firefox 30, Gecko allows

    , , and elements with a position: relative; style to act as absolute positioning containers. This means that a position: absolute; styled element inside the table can be positioned relative to these elements. In other browsers and in older versions of Firefox, setting position: relative; on a table row or row group has no effect. Firefox helps developers transition to the new behavior and detect any rendering issues it may cause on their sites by printing a warning to the JavaScript console if you use this feature: Relative positioning of table rows and row groups is now supported. This site may need to be updated because it may depend on this feature having no effect.

    [2] In Firefox 26 to Firefox 31 (inclusive), sticky positioning only works when the about:config preference layout.css.sticky.enabled is set to true. From Firefox 27 to 31, true is the default value for Nightly and Aurora versions of the browser. The preference has been removed in Firefox 48.

    [3] In Internet Explorer, fixed positioning doesn't work if the document is in quirks mode.

    [4] Prior to Firefox 44, position: fixed didn't create a stacking context in most cases. The specification, and Gecko implementation, have been modified to mimic Chrome and Safari's long-time behavior.

    [5] Sticky positioning is in preview for Edge.

    点赞 评论
  • u014074697
    张大教主 2017-07-21 06:51
    点赞 评论
  • sysu_Mid
    很可爱的Mid 2017-07-21 06:57


    点赞 评论
  • q34323201
    郑禄 2017-07-21 08:58

    position 在该用的地方用就好了, 用错地方 会乱

    点赞 评论