Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove iframe horizontal scrollbar

Tags:

html

iframe

I want to remove the horizontal scrollbar in my iframe. I just need a vertical scrollbar to view the lengthy contents. My code is

<iframe height='514' width='790' 
        marginwidth='0' marginheight='0' 
        frameborder='0' 
        overflow-y='scroll' 
        overflow-x='hidden'>
</iframe>

Anyone please solve my problem. Advance Wishes.

like image 781
Shankaralwar Avatar asked Aug 10 '10 11:08

Shankaralwar


People also ask

How do I get rid of the scroll bar in iframe?

A simpler way is however, is to use a container div styled with overflow: hidden; to hide the scrollbar. Set the width and the height of the div, to be slightly less than that of your iframe. Hope this helps you.

How can I hide scrollbar in iframe but still scroll?

1. Set the overflow of the parent div as hidden. 2. Set the overflow of the child div to auto and the width 200% (or anything more than 100%, or more than the width of the parent - so that the scrollbar gets hidden).

How do I get rid of the horizontal scroll bar in Chrome?

2. Type "Remove Scrollbars" (without quotes) in the search box and press "Enter." Click the "Remove Scrollbars" option located on top of the search results.


2 Answers

In the iframe page itself, add this:

body {
    overflow-x:hidden;
    height:100%; //optional, but it can't hurt.
}
like image 108
justacoder Avatar answered Sep 28 '22 15:09

justacoder


If you are using a browser that supports CSS3 you could use the overflow-x property.

#my-iframe
{
   overflow-x:hidden;
}
like image 37
jswanson Avatar answered Sep 28 '22 15:09

jswanson