HTML5 iFrame Seamless Attribute

后端 未结 10 1071
日久生厌
日久生厌 2020-11-27 14:41

in HTML5 the iframe has new attributes like \'seamless\' that should remove borders and scrollbars. I\'ve tried it but doesn\'t seem to work, I still can see scrollbars and

10条回答
  •  温柔的废话
    2020-11-27 15:16

    I thought this might be useful to someone:

    in chrome version 32, a 2-pixels border automatically appears around iframes without the seamless attribute. It can be easily removed by adding this CSS rule:

    iframe:not([seamless]) { border:none; }
    

    Chrome uses the same selector with these default user-agent styles:

    iframe:not([seamless]) {
      border: 2px inset;
      border-image-source: initial;
      border-image-slice: initial;
      border-image-width: initial;
      border-image-outset: initial;
      border-image-repeat: initial;
    }
    

提交回复
热议问题