6

I need to remove vertical scrollbar in an iframe. I have tried using overflow: hidden; still not working. Please help.

How it looks now

Code:

#iphone4 {
background-image: url("ipad_new2.png");
background-repeat: no-repeat;
height: 900px;
width: 750px;
margin: auto ;
position: relative;
overflow: hidden;
}


/*Mobile iframe CSS*/
iframe {
height: 700px;
width: 525px;
position: absolute;
top: 68px;
margin: auto ;
left: 61.99px;
overflow-y: scroll;

}

</style>
</head>
<body>
 <div id="iphone4" >
<iframe src="index_atish.html" seamless="seamless"></iframe>
</div>

</body>
</html>
Roman
  • 3,563
  • 5
  • 48
  • 104
Hrushi Patil
  • 63
  • 1
  • 1
  • 6

4 Answers4

10

overflow isn't a solution for HTML5 as the only modern browser which wrongly supports this is Firefox.

A current solution would be to combine the two:

<iframe src="" scrolling="no"></iframe>

iframe { overflow:hidden; }

check This

Community
  • 1
  • 1
Amitesh Kumar
  • 3,051
  • 1
  • 26
  • 42
2

I think it'll help please check below mentioned link:

<div id="iphone4" >
<iframe src="index_atish.html" seamless="seamless"></iframe>
</div>

/*Mobile iframe CSS*/
iframe {
height: 100%;
width: 100%;
position: absolute;
top: 0;
margin: auto ;
left: 0;
border:none;
}
body{margin:0px;}

https://jsfiddle.net/xnt014a8/2/

0

You can't really remove vertical scrollbar if you have dynamic content in your iframe using any css property.

You can refer this answer to set height dynamically at load time. If your content inside iframe is constantly changing then you have to use something like MutationObserver and the pass the resize function as an callback defined in the linked answer.

Krishna
  • 6,107
  • 2
  • 40
  • 43
-2

you could try

iframe{scrolling="no"}
Bomskie
  • 171
  • 8