I am attempting to create a series of circles with background images and accompanying text displayed side by side. My goal is to have the image opacity change and the text disappear upon hovering over each circle. Additionally, I do not want underlines to appear beneath the links. However, I am encountering several issues.
Below is my CSS code:
.ccont {
display: inline-block;
margin: 10px;
}
.circle {
position: relative;
height: 180px;
width: 180px;
border-radius: 50%;
justify-content: center;
align-items: center;
overflow: hidden;
display: table-cell;
vertical-align: middle;
text-align: center;
text-decoration: none;
padding: 0 10px;
}
.circle:after {
content: "";
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-image: url(http://deepchains.com/images/team.png);
background-size: cover;
background-repeat: no-repeat;
z-index: -1;
opacity: 0.2;
}
.circle__text {
padding: 1px;
background-color: none;
}
.circle:hover:after {
opacity: 1;
}
.ccont:hover {
font-size: 0;
}
and here is the HTML code:
<center>
<A href="http://www.url1.html" ><div class="ccont" style="font-weight: bold"><div class="circle">This is <br>Text1</div></div></A>
<A href="http://www.url2.html"><div class="ccont" style="font-weight: bold"><div class="circle">Text2</div></div></A>
</center>
Here are the current issues:
- Upon page load, underline links appear below the images due to the use of
a
.
https://i.sstatic.net/3nasQ.png
- When hovering over the left image, the text disappears but the circle becomes deformed.
https://i.sstatic.net/vERZh.png
- When hovering over the right image, the text correctly disappears.
https://i.sstatic.net/yqM2j.png
Here are my questions:
How can I remove the underline marks under the images that have links despite using
text-decoration: none;
?Why does the left image deform when hovered over while the right image remains unaffected?
Is it possible to have different background images for the left and right circles?
UPDATE:
After applying @chriskirknielsen's solution, the alignment of the two images appears off:
https://i.sstatic.net/Qc518.png
The misalignment seems to be caused by the underlines being aligned, resulting in the images being pushed to different vertical locations. Perhaps removing the underlines could resolve this issue?