Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

Creating Intrinsic Ratios

.wrapper-with-intrinsic-ratio {
	position: relative;
	padding-bottom: 20%;
	height: 0;
}

.element-to-stretch {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: teal;	
}
Source by alistapart.com #
 
PREVIOUS NEXT
Tagged: #Creating #Intrinsic #Ratios
ADD COMMENT
Topic
Name
6+2 =