Created
February 12, 2015 13:31
-
-
Save olivmonnier/bb3d7a53a37ff8f23c08 to your computer and use it in GitHub Desktop.
Create div element relative to img width
This file contains 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 class="wrapper"> | |
<div class="img-bloc"> | |
<img src="/"/> | |
<div class="actions-bloc"> | |
<a href="#" class="btn">Learn more</a> | |
</div> | |
</div> | |
</div> |
This file contains 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
.wrapper { | |
position: relative; | |
display: inline-block; | |
} | |
.img-bloc { | |
float:left; | |
} | |
.actions-bloc { | |
position: absolute; | |
left: 0; | |
right: 0; | |
bottom: 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment