I made a banner list thenk put my website, on desktop there is no problem bu on mobile its cutting the banners.
Mobile view
this is my iframe placement code:
<iframe scrolling="no" width="75%" height="670"src="/html/banners.html"></iframe>
<style>
iframe {
margin: 0 auto;
display: block;
}
#media(min-width:480px) {
iframe {
height:750px !important;
}
</style>
and this is my banner list codes: Banner list code
How can I resolve thisheight issue? can yoou please help me?
Many thanks.
Please refer to this article Using David J Bradshaw's iframe-resizer to solve iframe height and width issues.
You can to add a containing wrapper around the iframe.
<div class="iframe-container">
<iframe src="http://www.youtube.com/embed/4aQwT3n2c1Q" allowfullscreen="" frameborder="0">
</iframe>
</div>
Then. you can add css.
.iframe-container{
position: relative;
padding-bottom: 56.25%;
padding-top: 35px;
height: 0;
overflow: hidden;
}
.iframe-container iframe {
position: absolute;
top:0;
left: 0;
width: 100%;
height: 100%;
}
Related
I need to remove vertical scrollbar in an iframe. I have tried using overflow: hidden; still not working. Please help.
How it looks now
Code:
#iphone4 {
background-image: url("ipad_new2.png");
background-repeat: no-repeat;
height: 900px;
width: 750px;
margin: auto ;
position: relative;
overflow: hidden;
}
/*Mobile iframe CSS*/
iframe {
height: 700px;
width: 525px;
position: absolute;
top: 68px;
margin: auto ;
left: 61.99px;
overflow-y: scroll;
}
</style>
</head>
<body>
<div id="iphone4" >
<iframe src="index_atish.html" seamless="seamless"></iframe>
</div>
</body>
</html>
overflow isn't a solution for HTML5 as the only modern browser which wrongly supports this is Firefox.
A current solution would be to combine the two:
<iframe src="" scrolling="no"></iframe>
iframe { overflow:hidden; }
check This
I think it'll help please check below mentioned link:
<div id="iphone4" >
<iframe src="index_atish.html" seamless="seamless"></iframe>
</div>
/*Mobile iframe CSS*/
iframe {
height: 100%;
width: 100%;
position: absolute;
top: 0;
margin: auto ;
left: 0;
border:none;
}
body{margin:0px;}
https://jsfiddle.net/xnt014a8/2/
You can't really remove vertical scrollbar if you have dynamic content in your iframe using any css property.
You can refer this answer to set height dynamically at load time. If your content inside iframe is constantly changing then you have to use something like MutationObserver and the pass the resize function as an callback defined in the linked answer.
you could try
iframe{scrolling="no"}
How to make the iframe in responsive with full width
iframe {position:absolute;top:0;left:0;width:100%; height:100%;}
iframe, object, embed {
max-width: 100%;
}
This is my code but not working
Note:
If we have used height in pixels(IFRAME Tag) then comes correctly in full width. But not working in responsive
what is the solution?
I think this is what you are looking for. I assume that you are using YouTube so just paste in the embed link where the other link is.
HTML
<div class="videoWrapper">
<!-- Copy & Pasted from YouTube -->
<iframe width="560" height="349" src="http://www.youtube.com/embed/n_dZNLr2cME?rel=0&hd=1" frameborder="0" allowfullscreen></iframe>
</div>
CSS
.videoWrapper {
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: 0;
}
.videoWrapper iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
I used this guide: https://css-tricks.com/NetMag/FluidWidthVideo/Article-FluidWidthVideo.php
I used the same method for my own website and it works great. Hope this helps you out!
When my browser window is shrunk the YouTube video in my main div doesn't shrink with the browser. I tried some code I found online that was going to "solve" the problem, but it never turned out well and didn't look good. My biggest problem with it, was that the video never stayed centered as the browser window shrunk.
This is the code from the website:
HTML:
<div class="video-container">
<iframe src="http://www.youtube.com/embed/dFVxGRekRSg" frameborder="0" width="560" height="315"></iframe>
CSS:
.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px; height: 0; overflow: hidden;
}
.video-container iframe,
.video-container object,
.video-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
Question: Does anybody know how I can have an embedded YouTube video be responsive while staying centered (both vertically and horizontally) in the div that it's located in?
Here is my code: http://jsfiddle.net/MyersAN/xk700bng/
I tried with this class
.videowrapper {
float: none;
clear: both;
width: 100%;
position: relative;
padding-bottom: 56.25%;
padding-top: 25px;
height: 0;
}
.videowrapper iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
and add div element with youtube embedded code
<div class="videowrapper">
<iframe width="560" height="349" src="link" frameborder="0" allowfullscreen></iframe>
</div>
It works, also you should follow this tutorial with demo code.
So I am using an iFrame in my website to display a video and I put it in a div to allow for resizing on mobile sties and just to make it more responsive etc. However now, if the monitor is small, the content below the iframe is cut off.
Here is the code for the iframe:
<div class="wrapper">
<iframe src="https://player.vimeo.com/video/132695239?badge=0" width="960" height="540" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>
<style>
.wrapper {
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: 0;
}
.wrapper iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
</style>
If anyone can see anything that may cause this behaviour then I would love to know.
Thanks
Edit:
Here is the code for the div that I am trying to scale. The width doesn't change as the page is scaled down and thus the height also does not change.
Any ideas?
<style>.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style><div class='embed-container'><iframe src='http://player.vimeo.com/video/66140585' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>
The issue is that your wrapper div .splash-page .main-wrap is set to position: absolute; and overflow-y: hidden; this doesn't allow the div to grow to fit all your content.
If you change your CSS to include something like this:
.splash-page .main-wrap {
overflow-y: visible;
position: relative;
}
It will allow the div to grow to accommodate all your content.
You also could wrap the whole thing in a media query if you just wanted to target a specific width.
#media all and (min-width: 1001px) {
...
}
Currently you'll also have a duplicating background issue because your using .wsite-background on both a div and your body tag. If you remove this class from your body tag, it should look better.
Your iframe has a fixed with.
Try using width="100%" instead of width="960"
I want to position Google maps on the bottom of my page, but no matter what numbers I insert, it keeps staying on the top left hand corner and won't budge. I can resize it, but I can't seem to move the positioning. Any help?
HTML:
<iframe
marginwidth="0" marginheight="0" scrolling="no" width="422" height="300"
frameborder="0" scrolling="no"
src="https://maps.google.ca/maps?ie=UTF8&cid=7805933538308657347&q=Hibiscus&gl=CA&hl=en&t=m&z=16&iwloc=A&output=embed">
</iframe>
CSS:
.iframe {
position: absolute;
padding-bottom: 65%;
padding-top: 30px;
overflow: hidden;
top: 8000px;
left: 400px;
width: 100%;
height: 100%;
}
Simply put the iframe in the footer tag of your page.
HTML
<html>
<body>
stuff...
</body>
<footer>
<iframe style="width:100%; height:100%; position:absolute;"
marginwidth="0" marginheight="0" scrolling="no" width="422" height="300"
frameborder="0" scrolling="no"
src="https://maps.google.ca/maps?ie=UTF8&cid=7805933538308657347&q=Hibiscus&gl=CA&hl=en&t=m&z=16&iwloc=A&output=embed">
</iframe>
</footer>
</html>
CSS
.iframe {
position: absolute;
padding-bottom: 65%; //65% padding-bottom is massive... are you sure you want that much?
padding-top: 30px;
width: 100%;
height: 100%;
//overflow:hidden; Why that? Doesn't do anything usefull in this situation.
//left:400; Is it supposed to be 400px? If so, your page is pretty huge considering you have a map the size of your page.
}
Since you are implementing position absolute, I guess you can just add bottom:0; in the iframe class if you want it to be always at the bottom of the page
.iframe {
position: absolute;
bottom:0;
overflow: hidden;
left: 400px; <-- do you want to set margin on the left side of the map?
width: 100%;
height: 100%;
}
I think your problem lies in your CSS. You have a .iframe which means any elements with class="iframe" will inherit those properties. Your html you supplied doesn't look like it has anywhere a class of iframe. You can either keep your CSS the same and add class="iframe" to your iframe or change .iframe to iframe in your CSS. Personally I'd go with the .iframe and add class="iframe" to the iframe but I'd rename the class to something like .google-maps
<iframe class="iframe" ...></iframe>
iframe /*or*/ .iframe{
position: absolute;
padding-bottom: 65%;
padding-top: 30px;
overflow: hidden;
top: 8000px;
left: 400px;
width: 100%;
height: 100%;
}
EDIT:
Looking over your question again I have a suggestion to try position:{absolute, relative or fixed} to see if changing the position attribute which might solve your problem.