Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

css embed no scrollbar

Alright, I have a a page with an ajax button on it. When you hit the ajax button, it throws an embed object into the 'data' div. Everything works fine, my problem is that the embed is creating a scrollbar that I don't want. Any ideas on how to prevent the scrollbar? I've already tried throwing 'overflow: hidden' everywhere I could with no success =/

~html~

http://pastebin.com/WZ2YzDVb

~my.css~

http://pastebin.com/iR335BNj

~ajax embed data~

<embed width=100% height=100% type='text/html' style='overflow: hidden' src='source'>

I used pastebin to keep my post clean.

like image 679
mrdj204 Avatar asked Jul 12 '13 03:07

mrdj204


2 Answers

When you see the scroll bar in an element, you are actually seeing the scroll bar for that element's webpage. You can't fix it my giving the <embed> a style, you have to give the <body> of the <embed> a style. Here's what solved it for me:

[MainFile.html]

<html>
   <body>
      <embed style='border:1px solid black;' src='EmebdedFile.html'></embed>
   </body>
</html>


[EmbededFile.html]

<html>
   <body style='overflow:hidden'>
      <img src='smile.png' style='height:1000px; width:1000px;'></img>
   </body>
</html>


Notice that 'overflow:hidden' is in the HTML file of the embedded element.

like image 114
user1544522 Avatar answered Sep 25 '22 12:09

user1544522


Use your embed tag inside a container with overflow hidden. Then set the width of the embed with 100% + 17px (the default width of a scrollbar).

like image 41
João Paulichi Avatar answered Sep 22 '22 12:09

João Paulichi