CSS: Positioning an iFrame to the bottom right of the browser, possible?
try with fixed position
.iframe {
position: fixed;
bottom: 10px;
right: 20px;
width: 535px;
height: 380px;
z-index: 999;
}
Chrome position:fixed inside position:absolute breaking with iframe / video
FIX: add these rules to the position:fixed
element:
-webkit-backface-visibility: hidden;
-webkit-transform: translateZ(0);
How to align iframe vertically?
Here you go.
http://jsfiddle.net/UFMP7/1/
The trick is to play with the margin and the top offset properties of the nested element.
In this case, given a parent div (A) of 300px, I've offset the nested div (B) by 50% of 300, which is 150. So B is positioned 150px down from the top of the A container. However, we aren't finished. In order to get the center of B to match the center of A, we are required to apply the negative 50% of B's height to the margin-top property. This centers it and the math checks out.
It's even easier if you know the dimensions of everything in pixels.
Feel free to change the A width or height. It'll center dynamically.
div#a
{
width: 300px;
height: 300px;
border-width:1px;
border-style: solid;
/* important stuff below */
display: inline-block;
}
div#b
{
width: 60px;
height: 60px;
background-color: red;
/* important stuff below */
position: relative;
margin: -30px auto 0 auto;
top: 50%;
}
As such, I'd suggest wrapping your iframe in a div. It gives you a bit more control. Then again, I'm one of those excessive div wrappers...
Related Topics
How to Change CSS When It's Ng-Disabled
Bootstrap 3: How to Create Responsive, Square .Thumbnail Divs
Two Divs on The Same Row and Center Align Both of Them
Is There an Equivalent of Spriting for Svg Images in Web Pages
Bootstrap Navbar-Static-Top Menu Breaks on Two Lines
Selecting Children Elements But Not Grandchildren
Is There a CSS Selector to Match a Option Value of The Select Tag
Ionic - Center Text Vertically in Item-List with Item-Avatar Class
Internet Explorer CSS Property "Filter" Ignores Overflow:Visible
CSS Color Names + Alpha Transparency
Using CSS Approach How to Set an Image to Fill a Path in Svg
Bootstrap: How to Create a Series of Div on One Line Hiding The Overflowing Divs
Can Bootstrap 3 Grid Be Extended
CSS- Target Text Links with Bottom Border on Hover, But Image Links with No Border