Positioning an Icon Over an Image or Video
Problem:
You need to position an icon over an image or video, aligning it to the bottom left corner. When clicked, the icon should trigger a download prompt for the image.
Solution:
To achieve the desired positioning, you need to create a relative container around the image. Then, set the icon's position to absolute. Here's a code example:
.container {
position: relative;
}
.container img {
display: block;
}
.container .fa-download {
position: absolute;
bottom: 0;
left: 0;
}
Bootstrap 3 Font-Awesome:
Yes, the same method works for Bootstrap 3 Font-Awesome. Replace the Font Awesome version in the code above with the following:
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3