overflow: hidden; doesn't work on Chrome with IFRAMEs?

前端 未结 6 1347
失恋的感觉
失恋的感觉 2020-12-14 00:33

I have an IFRAME with overflows hidden in the css and html. It works in Firefox, but not Chrome/Safari

Why is this?

6条回答
  •  粉色の甜心
    2020-12-14 00:36

    After a pretty big research I've done on this subject I would like to post my answer, which I suggest, could be an addition to Joonas's answer:

    
    (...)
    
    

    I think, both scrolling and overflow:hidden should be provided, although this solution won't work in a combination of Chrome and HTML5 doctype. scrolling attribute is deprecated in HTML5 and the overflow property doesn't affect iframes in Chrome. I assume, the latter is a bug, since the HTML5 specification says clearly:

    In addition, HTML5 has none of the presentational attributes that were in HTML4 as their functions are better handled by CSS:
    (...)
    - nowrap attribute on td and th.
    - rules attribute on table.
    - scrolling attribute on iframe.
    - size attribute on hr.
    - type attribute on li, and ul.
    (...)

    It's said clearly - in HTML5 scrolling should be replaced by CSS overflow.

提交回复
热议问题