I know this question has been asked a number of times but I keep seeing the answer for using...
postion: absolute;
bottom: 0;
However, it doesn't really work in my case, so was looking for other suggestions.
And answers for using flex don't seem to work because of my column layout. I am also pretty knew to flex so I don't know it awfully well.
I have an image on the left that has a set width of 145px, but can differ in height.
On the right, I have a div that contains 2 divs (TimelineAddress
& TimelineFavouriteUser
) with spans inside each one. One for property address and another with a user name and some text appended. I would like the div TimelineFavouriteUser
to sit at the bottom so it is inline with the bottom of the image. See diagram below.
----------- ----------------------------
|Image | Address - Dynamic Length |
|Can be | |
|different | |
|heights | |
| | |
| | |
| | |
| | |
| | User and text at bottom |
----------- ----------------------------
This can be achieved by using
postion: absolute;
bottom: 0;
However, when it comes to responsiveness and lower resolutions the address can overlap the text at the bottom as the address text breaks into more an and more lines. See image below.
I have used some javascript to dynamically add the correct margin-top
to
TimelineFavouriteUser
, although, I'd prefer a CSS only solution as the function that runs the calculation for margin-top
value gets called a lot as there could be 100's of these elements on the screen.
I know this may be possible with flex
, however, we need to support at least IE9
so if there was a solution for IE9
, that would be great.
If not then I can perhaps come up with a solution for browsers where flex
is not supported if flex
is the best solution.
I have a JSFiddle if you'd like to test it out for yourself.