HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Learn how to create an avatar image with CSS
Step 1) Add HTML:
<img src="avatar.png" alt="Avatar" class="avatar">
Step 2) Add CSS:
Set a matching height
and width
that looks good, and use the border-radius
property to add rounded corners to an image. 50% will make the image circular:
.avatar {
vertical-align: middle;
width: 50px;
height: 50px;
border-radius: 50%;
}
Try it Yourself »
Go to our CSS Images Tutorial to learn more about how to style images.