Menu Close

How To Create Avatar Images Using CSS

Avatar images

Let’s see how to create avatar images by using CSS properties. First add the images on img tag then write down the CSS properties for those images. Follow the below example to create this.

Example:

<!DOCTYPE html>
<html>
<head>
    <title>How To Create Avatar Images Using CSS</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
        .avatar-images {
          vertical-align: middle;
          width: 50px;
          height: 50px;
          border-radius: 50%;
        }
    </style>
</head>
<body>
    <h3>Avatar Images</h3>
    <img src="c1.jpg" alt="Avatar images" class="avatar-images">
    <img src="c2.jpg" alt="Avatar images" class="avatar-images">
</body>
</html>
 
Posted in CSS, HTML

You can also read...