Direkt zum Inhalt Zur Suche Zum Menü


Responsive container css for iframe, object, embed


2013-08-06

Just for documentation.
If you do not understand this, you probably do not need it.

Thanks to Guido

Please note: This is scss code

.responsive-wrapper {
	position: relative;
	width: 100%;
	height: 0;
	overflow: hidden;
	&.ratio3x1 {
		padding-bottom: 33.333333333% !important;
	}
	&.ratio2x1 {
		padding-bottom: 50% !important;
	}
	&.ratio16x9 {
		padding-bottom: 56.25% !important;
	}
	&.ratio3x2 {
		padding-bottom: 66.66666666% !important;
	}
	&.ratio4x3 {
		padding-bottom: 75% !important;
	}
	&.ratio1x1 {
		padding-bottom: 100% !important;
	}
	iframe, object, embed {
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
	}
}