Code Snippet to Position a <div> element on bottom of it’s parent div container
If you have a parent div container which includes other div element and wants to fix the inner div element to the bottom of the parent container check this 2 simple style rules to make it happen. For example, if you have the following HTML div elements:
<div class=”main-element”> <div class=”inside-main-element”>Some Text Message</div> </div>
To add the second inner div with a fixed bottom position of the parent div container you need to add these rules in your CSS code like the example below:
.main-element { position: relative;} .inside-main-element{ position: absolute; bottom: 10%; left:10%;}
After adding the code from above you will have the first div container with your style and options and the inner div will be fixed at the bottom of the height of the parent div container with absolute position rule and bottom CSS rule