Reputation: 2375
Image should be inside the circle and circle should have white background.
and Image size should be less than the circle and in center.
I try this:
.icon i {
color: #fff;
width: 40px;
height: 40px;
border-radius: 20px;
font-size: 25px;
text-align: center;
margin-right: 10px;
padding-top: 15%;
}
<li><a href="#"><i class="icon" style="background: red;"> <img src="http://www.pngdot.com/wp-content/uploads/2015/11/Free_Arrow_Png_01.png" style="width:50px;height:45px;"></i></a></li>
Upvotes: 3
Views: 20126
Reputation: 95
I think the container div or i which have a radius and image content should be overflow hidden
i{
overflow:hidden;
}
Upvotes: 0
Reputation: 134
You do not need icon element for any purpose. So, you can achieve asked with following HTML:
<li>
<a href="#" id="circle"></a>
</li>
DEMO: CLICK
Upvotes: 1
Reputation: 9739
You can do this:
CSS
body{
background: #f1f1f1;
}
figure{
display:block;
width:50px;
height: 50px;
border-radius: 50px;
font-size: 25px;
text-align: center;
margin-right: 10px;
background: #fff;
line-height: 1.7em;
}
figure img{
display:inline-block;
width: 30px;
height: auto;
}
HTML
<li>
<a href="#">
<figure>
<img src="http://www.pngdot.com/wp-content/uploads/2015/11/Free_Arrow_Png_01.png" alt="image">
</figure>
</a>
</li>
Upvotes: 2
Reputation: 29337
If I understand you correctly can use border-radius
for the circle.
body {
background:#000;
}
* {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
i {
background: white;
border-radius: 20px;
font-size: 25px;
text-align: center;
margin-right: 10px;
border-radius:50%;
display:inline-block;
padding:10px;
}
img {
display:block;
}
<i><img src="https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/410.svg" width="30" /></i>
Upvotes: 4