Log in

View Full Version : A way to hide content at the top of an IFRAME with css maybe?


BirdOPrey5
09-25-2010, 07:49 PM
Curious if anyone knows how I can do this... Let's say I have a page in an iframe and the iframe content is 500px x 500px in size... I know if I set the iframe size to 500 x 400, no scroll bars, and overflow = hidden the bottom 100 pixels will be hidden from view.

My question is does anyone know if there's a way to hide the top 100 pixels instead? Sort of display from the bottom up? Could that be possible with css styles maybe?

kh99
09-25-2010, 07:57 PM
I don't really have any idea what would work, but did you try something like:

position:relative;
top:-100px;

BirdOPrey5
09-25-2010, 08:36 PM
That's close... the bottom is in the correct spot but the "overflow" on the top isn't hidden, it just comes in front of the other elements on the page. Weird... maybe I should check it in other browsers- I'm using Chrome.

kh99
09-25-2010, 08:44 PM
Maybe try adding a z-index:-1 ?

BirdOPrey5
09-25-2010, 09:05 PM
Actually check that, it's working great... I had to put the style tag into a DIV tag around the IFRAME instead of the IFRAME itself. :)

Thanks.