Looking for help with applying anchor tags to a styled image in CSS? I had already pushed the image to the right and resized it from 400px to 25px:
CSS:
.instagram-section {
text-align: right;
font-family: 'Life Savers', cursive;
font-size: 1em;
}
.ig-logo {
height: 25px;
}
However, once I surrounded the image in <a>
tags, all the styling seemed to disappear:
HTML (before adding anchor tags to image):
<div class="instagram-section">
<strong>... my <a href="https://www.instagram.com/myinstagram/">Instagram</strong></a>
<!-- <a href="https://www.instagram.com/myinstagram/"> -->
<img src="/img/icons/instagram/instagram-logo-400.png" class="ig-logo">
<!-- </a> -->
</div>
https://i.sstatic.net/gw8rr.jpg
HTML (after adding anchor tags to image):
<div class="instagram-section">
<strong>... my <a href="https://www.instagram.com/myinstagram/">Instagram</strong></a>
<a href="https://www.instagram.com/myinstagram/">
<img src="/img/icons/instagram/instagram-logo-400.png" class="ig-logo">
</a>
</div>
https://i.sstatic.net/AyOtT.jpg
If you're new to HTML/CSS like me, you might be struggling to keep the image size while aligning it correctly. Any advice on how to achieve this alignment would be greatly appreciated.
Feel free to share any tips or pointers!