Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Craig Watson
27,930 PointsPosition Element relative to the bottom of its parent?
Hi everyone!
I am just on building a little site using bootstrap, and would like to position a link in the carousel relative to the bottom of the element so that on each slide the position of the link is in the same place on every slide.
Is there a way of doing this without adjusting each link individually ? Am i missing something very simple...?
If possible In the simplest and most code effective way achievable I want the bottom of each image to be level on each slide as well as the position of the links being at the same level to?
Please ignore the nav colour and link colours this is still a working progress!
Hope this makes some sort of sense....
Craig
1 Answer
fitri
Front End Web Development Techdegree Student 10,450 Points- Set position to relative on parent container (.slide in this example).
- Set position to absolute on link and assign the value 0 to bottom (or the number of pixels from bottom, e.g. 50px)
.slide {
position: relative;
}
.link {
position: absolute;
bottom: 0;
}
This will however cause the elements inside link to layer over the parent container. So this could be fixed by adding padding-bottom to the parent container with the height of the link container. This is a common solution that I usually come across. you might not even need this part.
Hope this make sense.