The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Remove scroll bar from iframe, Show iframe without a vertical scroll bar
CharlesEF
post Feb 3 2019, 06:56 PM
Post #1


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



Hi All,

Ok, what is the trick to removing the scroll bar from an iframe. HTML5 specs state that CSS should be used but 'overflow: hidden;' has no effect. The only thing that does work is 'scrolling="no"' but HTML5 doesn't support it. The container that holds the iframe is big enough and the scroll bar should not appear but it does.

Does this mean I have to use HTML4 instead of HTML5?


Thanks for any help,

Charles
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
Christian J
post Feb 4 2019, 06:20 AM
Post #2


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



This works in my browsers:

CODE
iframe {
height: 300px;
width: 500px;
overflow: hidden;
border: 0;
}

<iframe src="http://example.org"></iframe>

If you increase text size, the framed content will of course need more space. Also make sure the scrollbars are from the iframe itself, and not from the parent page (or element) because the iframe is too large.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 6 2019, 01:34 AM
Post #3


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



QUOTE(Christian J @ Feb 4 2019, 12:20 PM) *

This works in my browsers:

CODE
iframe {
height: 300px;
width: 500px;
overflow: hidden;
border: 0;
}



Actually, that doesn't work for me. Not with any page loaded in an iframe. Odd, I seem to recall this used to be possible with CSS?

Charles, try to add the following to the CSS for db_tests.php . That ought to work.

CODE
body   { overflow: hidden }
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Feb 6 2019, 05:20 AM
Post #4


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE(pandy @ Feb 6 2019, 07:34 AM) *

Charles, try to add the following to the CSS for db_tests.php . That ought to work.

CODE
body   { overflow: hidden }


MSIE used to display a default scrollbar track for all pages (not just iframes) that you had to remove, is that the cause here? But I never got it in my other browsers (and not MSIE11/Win10 either now). unsure.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 6 2019, 11:42 AM
Post #5


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



QUOTE(Christian J @ Feb 6 2019, 11:20 AM) *

QUOTE(pandy @ Feb 6 2019, 07:34 AM) *

Charles, try to add the following to the CSS for db_tests.php . That ought to work.

CODE
body   { overflow: hidden }


MSIE used to display a default scrollbar track for all pages (not just iframes) that you had to remove, is that the cause here? But I never got it in my other browsers (and not MSIE11/Win10 either now). unsure.gif


Got it in all browsers I tried. FF, Iron, Edge and even K-Mel that's pretty dated now. I tried locally with just an three iframes in a page and loaded Charles' page in one and a long and a short local page in the others. It worked only if the page was small enough to fit, but then it would work without anything extra.

What's an even greater mystery is that today it works in all the browsers I mentioned. I get that Charles has modified his page, but I also have another really long local page in another iframe. I haven't changed a character in the test page. What's even more mysterious is that I don't get scrollbars even if I remove the CSS, i.e. just have the iframe tag with no attributes more than src. My Win10 is still majorly screwed up, but I don't understand how that could cause this. It can't be caching in all browsers. I added some text and it shows up.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 6 2019, 12:19 PM
Post #6


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



Ah! I had of course added overflow: hidden to BODY in the long test page. What can I say? I'm stupid. biggrin.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic
CharlesEF   Remove scroll bar from iframe   Feb 3 2019, 06:56 PM
Christian J   This works in my browsers: iframe { height: 3...   Feb 4 2019, 06:20 AM
pandy   This works in my browsers: [code]iframe { height...   Feb 6 2019, 01:34 AM
Christian J   Charles, try to add the following to the CSS for ...   Feb 6 2019, 05:20 AM
pandy   [quote name='pandy' post='136746' date='Feb 6 201...   Feb 6 2019, 11:42 AM
pandy   Ah! I had of course added overflow: hidden to ...   Feb 6 2019, 12:19 PM
CharlesEF   No, it doesn't work for me. I tried it on the...   Feb 4 2019, 01:33 PM
CharlesEF   I put together a basic page to show my problem. S...   Feb 5 2019, 10:35 PM
CharlesEF   Yeah, it worked! :D I added a 'style...   Feb 6 2019, 02:16 AM
CharlesEF   I always thought that <iframe>Text in here...   Feb 6 2019, 11:33 AM
pandy   I always thought that <iframe>Text in here...   Feb 6 2019, 12:45 PM
Christian J   I always thought that <iframe>Text in here...   Feb 6 2019, 12:49 PM
pandy   From the drupal page I linked to. According to th...   Feb 6 2019, 01:18 PM
Christian J   Or do you mean about the scroll bars? No I mean...   Feb 6 2019, 01:55 PM
pandy   Or do you mean about the scroll bars? No I mea...   Feb 6 2019, 02:40 PM
CharlesEF   Thanks to both of you. I guess I must be remember...   Feb 6 2019, 01:41 PM
CharlesEF   FYI, I ran across a situation where I needed the v...   Feb 8 2019, 01:07 PM
Christian J   I suppose you could use "overflow-y" to ...   Feb 8 2019, 01:42 PM
CharlesEF   I suppose you could use "overflow-y" to ...   Feb 8 2019, 04:01 PM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 25th April 2024 - 07:02 AM