Created
September 29, 2013 14:37
-
-
Save psflannery/6753051 to your computer and use it in GitHub Desktop.
From http://jsfiddle.net/BDEnM/2/ - equalise the height of divs/make achild div the height of it's parent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#container{ | |
width:400px; | |
} | |
#side{ | |
width:100px; | |
float:left; | |
background:#aeaeae; | |
} | |
#main{ | |
width:300px; | |
float:right; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="container"> | |
<div id="side"> | |
<ul> | |
<li>1</li> | |
<li>2</li> | |
<li>3</li> | |
</ul> | |
</div> | |
<div id="main"> | |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur commodo varius felis, vitae tempor augue sollicitudin sit amet. Nulla facilisi. Nulla quis dictum sem. Sed eget ante purus, id lacinia sapien. Ut scelerisque ultrices suscipit. Nam et quam at velit venenatis ultricies eget eu elit. Nulla sed nisl vitae massa vestibulum malesuada ac id nibh. Aliquam porta dignissim commodo. Sed accumsan nisl ultrices purus consectetur nec auctor urna gravida. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse enim metus, pulvinar sit amet malesuada non, ultrices id quam. | |
<img src="http://placekitten.com/300/300" /> | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#side").height( $("#main").height() ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment