Create a wrapper div that wraps both divs and give the CSS position. If A is position: relative
and B is in position: absolute
, object B calculates top
and left
attribute values based on object A.
.item-wrapper {
position: relative;
/* Omitted */
}
.item-info-box {
position: absolute;
left: 0;
bottom: 0.75em;
/* The following is omitted */
}
See Demo.
+ If you're wondering "How did this implement the CSS?" right-click and click "Exam". You'll get a hint when the browser developer tool pops up.
© 2024 OneMinuteCode. All rights reserved.