Remove scrollbar from iframe

HtmlCssIframe

Html Problem Overview


Using this code

<iframe frameborder="0" style="height: 185px; overflow:scroll; width: 100%" src="http://www.cbox.ws/box/?boxid=439&boxtag=7868&sec=main" marginheight="1" marginwidth="1" name="cboxmain" id="cboxmain" seamless="seamless" scrolling="no" frameborder="0" allowtransparency="true"></iframe>

This is how it appears (the shoutbox on homepage of http://www.talkjesus.com)

How do I remove the horizontal scrollbar and modify the css of the vertical scrollbar?

Html Solutions


Solution 1 - Html

Add scrolling="no" attribute to the iframe.

Solution 2 - Html

This works in all browsers

<iframe src="http://buythecity.com"  scrolling="no" style=" width: 550px; height: 500px;  overflow: hidden;" ></iframe>

Solution 3 - Html

Adding scroll="no" and style="overflow:hidden" on iframe didn't work, I had to add style="overflow:hidden" on body of html document loaded inside iframe.

Solution 4 - Html

Try adding scrolling="no" attribute like below:

<iframe frameborder="0" scrolling="no" style="height:380px;width:6000px;border:none;" src='https://yoururl'></iframe>

Solution 5 - Html

Just Add scrolling="no" and seamless="seamless" attributes to iframe tag. like this:-

 1. XHTML => scrolling="no"
 2. HTML5 => seamless="seamless"

UPDATE:

seamless attribute has been removed in all major browsers

Solution 6 - Html

If anyone here is having a problem with disabling scrollbars on the iframe, it could be because the iframe's content has scrollbars on elements below the html element!

Some layouts set html and body to 100% height, and use a #wrapper div with overflow: auto; (or scroll), thereby moving the scrolling to the #wrapper element.

In such a case, nothing you do will prevent the scrollbars from showing up except editing the other page's content.

Solution 7 - Html

<div id="myInfoDiv" seamless="seamless" scrolling="no" style="width:100%; height: 100%; float: left; color: #FFF; background:#ed8719; line-height:100%; font-size:100%; font-family: sans-serif>;

Use the above div and it will not show scroll bar in any browser.

Solution 8 - Html

Add this in your css to hide both scroll bar

iframe 
{
  overflow-x:hidden;
  overflow-Y:hidden;
}

Solution 9 - Html

It's the last resort, but worth mentioning:

You can use the ::-webkit-scrollbar pseudo-element on the iframe's parent to get rid of those famous 90's scroll bars.

::-webkit-scrollbar {
    width: 0px;
    height: 0px;
}

Edit: though it's relatively supported, ::-webkit-scrollbar may not suit all browsers. use with caution :)

Solution 10 - Html

iframe {
  display: block;
  border: none;         /* Reset default border */
  height: 100vh;        /* Viewport-relative units */
  width: calc(100% + 17px);
}
div {
  overflow-x: hidden;
}

Like this you make the width of the Iframe larger than it should be. Then you hide the horizontal scrollbar with overflow-x: hidden.

Solution 11 - Html

Add this in your css to hide just the horizontal scroll bar

iframe{
    overflow-x:hidden;
}

Solution 12 - Html

in your css:

iframe{
    overflow:hidden;
}

Solution 13 - Html

None of the above answers worked for me. This is what I did in JS:

Select the iframe element:

var iframe_name = document.getElementById("iframe_name");

Add the attribute to it:

  iframe_name.scrolling = "no";

Solution 14 - Html

Instead of iframe:

const blob = new Blob([data], { type: "application/pdf" });
const link = document.createElement("a");
const URL = window.URL.createObjectURL(blob);
link.href = URL;
link.download = filename;
//download the pdf
link.click();
//open the downloaded pdf in its default viewer
window.open(URL);

Solution 15 - Html

When nothing works, float:left could safe you.

iframe{float:left; clear:both;}

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionFaith In Unseen ThingsView Question on Stackoverflow
Solution 1 - HtmlDean OakleyView Answer on Stackoverflow
Solution 2 - HtmlThyagarajan CView Answer on Stackoverflow
Solution 3 - Htmlnirvana74vView Answer on Stackoverflow
Solution 4 - HtmlAllabux BView Answer on Stackoverflow
Solution 5 - HtmlNima RahbarView Answer on Stackoverflow
Solution 6 - HtmlWraithKennyView Answer on Stackoverflow
Solution 7 - HtmlKnightFuryView Answer on Stackoverflow
Solution 8 - HtmlDeepika PatelView Answer on Stackoverflow
Solution 9 - HtmlShayaView Answer on Stackoverflow
Solution 10 - HtmlNico GrillView Answer on Stackoverflow
Solution 11 - HtmlAbhidevView Answer on Stackoverflow
Solution 12 - HtmltakienView Answer on Stackoverflow
Solution 13 - HtmlDennis KozevnikoffView Answer on Stackoverflow
Solution 14 - Htmlpavithra ramasamyView Answer on Stackoverflow
Solution 15 - HtmlAndrésView Answer on Stackoverflow