Serbon
Serbon

Reputation: 33

How to hide scrolling bar from the iframed page

I have an iframe on HTML page, and I want to hide vertical "scrolling".

In my CSS, I input this, but I didn't get results, scrolling is still visible.

iframe{
    overflow:hidden;
}

Also, i try to use "style= scrolling="no"" but still withouts success.

Upvotes: 0

Views: 594

Answers (4)

Joshua
Joshua

Reputation: 446

You can use <iframe src="#" scrolling="no"></iframe>. Hope that helps!

Upvotes: 1

Nitesh
Nitesh

Reputation: 1550

If iframe content is in same domain and If you are ready to use JS to hide scroll inside iframe content, you can use this:

var elem = document.getElementById("if");
elem.contentDocument.body.style.overflow="hidden"

considering "if" as id of your iframe.

or use scrolling="no" as mentioned in another answer.

Upvotes: 0

Serbon
Serbon

Reputation: 33

I fix the problem by adding position: fixed in css.

Upvotes: 1

user149341
user149341

Reputation:

scrolling="no" is an attribute, not a CSS property. It doesn't need to be wrapped in style:

<iframe
  src="https://example.com/"
  width="100" height="100"
  scrolling="no"
>
</iframe>

Upvotes: 1

Related Questions