Im trying to do the following x icon, exactly the way it is in here:
So here is the html:
<div class='error-circle'>
<div>X</div>
</div>
And here is the css:
.error-circle{
width: 70px;
height: 70px;
background: #990000;
border-radius: 100px;
border: 4px solid white;
color: white;
font-size: 45px;
font-weight: bold;
padding-left: 17px;
}
It's close, but i really need the same result as the image (without the background), I think the X should not be the x character but two lines crossed one on the other, How should i achieve this result?
Wrap the image in a div The markup to set up CSS-only cropping is super basic. All you need to do is wrap the img tag in a div . The pug image is 750 pixels wide and 500 pixels high. Let's make it portrait-oriented by maintaining the 500 pixel height, but chopping the width in half to 375 pixels.
Assign the Positions This is the most important step. The first step to enclose the components along with the image as one element and assign the CSS property position: relative . And the icons we need to place on the image is assigned the property position: absolute . In this case, we are adding the class .
The simplest way to add an icon to your HTML page, is with an icon library, such as Font Awesome. Add the name of the specified icon class to any inline HTML element (like <i> or <span> ). All the icons in the icon libraries below, are scalable vectors that can be customized with CSS (size, color, shadow, etc.)
The :hover selector is used to select elements when you mouse over them. Tip: The :hover selector can be used on all elements, not only on links. Tip: Use the :link selector to style links to unvisited pages, the :visited selector to style links to visited pages, and the :active selector to style the active link.
1) Remove padding
2) Change border-radius to 50%
3) Try a different font like verdana
FIDDLE
.error-circle {
width: 70px;
height: 70px;
line-height: 70px;
background: #990000;
border-radius: 50%;
border: 4px solid white;
color: white;
font-size: 45px;
font-family: verdana;
text-align: center;
}
<div class='error-circle'>
<div>X</div>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With