I have an issue about define the positions of icons on pictures.
My current visual:
and I would like to have something like this:
and on hover I would like to have an edit icon, like this:
my current html:
<div class="artist-collection-photo">
<button class="close" type="button">×</button>
<a data-target="#photo-fields-5-0" data-toggle="modal">
<img width="120" height="120" alt="image.jpg" class="img-thumbnail">
</a>
</div>
and css:
.artist-collection-photo {
float: left;
margin: 10px;
cursor: pointer;
width: 120px;
height: 120px;
}
I would appreciate your help, I’m horrible with visual parts 🙁
PS: The edited the example images in photoshop
Thanks!
2
Answers
I think this is what you want: https://jsfiddle.net/c259LrpL/30/
set
.artist-collection-photo {position: relative;}
then set
.close{position: absolute;}
this will position the button inside the image, then position it using
top: 0;
andright: 0;
For the fade portion you see here: https://jsfiddle.net/c259LrpL/31/
http://www.bootply.com/IRZvpTK41g
Your containing div (the photo) needs to be set to position relative and the button X needs to be set to
position:absolute
. Tweak with the measurements. To get the button to change color on hover, just add thebutton:hover
pseudoclass and change the color there.