css - How to ALWAYS show scrollbar in iframe in HTML5 -


is there way show scrollbar on iframe in html5, if content not overflowing? scrolling="yes" attribute doesn't work in html5. there way using css?

it seems scrolling="yes" supported browsers only. judging simulation of older versions in ie 11, seems ie 8 dropped support: although attribute such recognized, value yes not—scroll bars shown when content not fit in.

this change in browser practices. has nothing html5. in fact, html5 describes attribute scrolling="yes" mapping css setting overflow: scroll, misleading.

modern browsers implement iframe scroll bars present, if needed accessing of content, not otherwise. using scrolling=no or overflow: hidden, can prevent scroll bars appearing, not make them appear if content fits (there no overflow).

to make scroll bars appear, need make embedded document set them up, e.g. using body { overflow: scroll } in it. not matter iframe element says. scroll bars passive (and light grey), when content fits, there occupy space, , turn active scroll bars content expands not fit. in following example, embedding page sets body { overflow: scroll } , has editable body element, can add lines , see how bars change:

<iframe src="http://www.cs.tut.fi/~jkorpela/hello.html"></iframe>


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -