My instructor has provided us with this code snippet:
<a class="btn btn-tertiary" href="#">
<span class="circle">
<i class="arrow-right">
</i>
</span>Create profile
</a>
.btn.btn-tertiary {
position: relative;
padding: 0;
text-align: left;
left: 70px;
top: 20px;
height: 50px;
}
.btn.btn-tertiary .circle {
transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
position: absolute;
z-index: -1;
width: 3em;
height: 3em;
background: #1d99ae;
border-radius: 2em;
left: -60px;
top: -10px;
}
.btn.btn-tertiary .arrow-right {
transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
position: absolute;
top: 0;
bottom: 0;
right: 14em;
left: 0.625em;
margin: auto;
width: 0.625em;
height: 0.625em;
border-top: 0.125em solid #fff;
border-right: 0.125em solid #fff;
transform: rotate(45deg);
}
.btn.btn-tertiary:hover .circle {
width: 100%;
}
.btn.btn-tertiary:hover {
color: #fff;
}
<a class="btn btn-tertiary" href="#">
<span class="circle">
<i class="arrow-right">
</i>
</span>Create profile
</a>
The task is to create a circular button with an arrow icon that expands over the text when hovered. It should be responsive to different screen sizes. Despite my best efforts, I am having trouble achieving the hover effect to take up 100% of the width within the container (refer to the fiddle).
https://jsfiddle.net/x1rnjgdL/
It's frustrating that I'm not allowed to edit the HTML code and the text cannot be placed in another span element with a class. This restriction is making the task quite challenging!
If anyone can provide assistance, it would be greatly appreciated. I have experimented with float, absolute or relative positioning, and grid layout, but I still can't achieve the desired hover effect to cover 100% of the container width. The goal is to make the button reusable in various placements with different text lengths.