---
title: "Avatar designing through HTML and CSS"  
description: "Avatar designing through HTML and CSS"  
author: "Anonymous User"  
published: 2021-07-20  
updated: 2023-06-09  
canonical: https://www.mindstick.com/forum/156551/avatar-designing-through-html-and-css  
category: "css-css3"  
tags: ["html", "css-css3"]  
reading_time: 2 minutes  

---

# Avatar designing through HTML and CSS

How to make an avatar using an [HTML](https://www.mindstick.com/articles/1530/design-a-simple-stylish-calculator-using-html-css-and-javascript) and [CSS](https://www.mindstick.com/forum/514/background-gradient-ie7-css-problem)?

## Replies

### Reply by Aryan Kumar

Sure, here's an example of how to design an avatar using HTML and CSS:

HTML

```plaintext
<html>
<head>
<title>Avatar</title>
<style>
.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background-color: #ffffff;
}
.avatar img {
  width: 100%;
  height: 100%;
}
</style>
</head>
<body>
<div class="avatar">
  <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/User_icon_2017.svg/1200px-User_icon_2017.svg.png" alt="Avatar">
</div>
</body>
</html>
```

The .avatar class is used to style the avatar element. The width and height properties set the width and height of the avatar element to 100px. The border-radius property sets the border radius of the avatar element to 50%, which will make it a circle. The background-color property sets the background color of the avatar element to white.

The .avatar img class is used to style the image element inside the avatar element. The width and height properties set the width and height of the image element to 100%, which will make it fill the entire avatar element.

You can use this code as a starting point to design your own avatars. You can change the background color, the image, and the border radius to create different looks. You can also use CSS to add additional styling, such as borders, shadows, and gradients.


---

Original Source: https://www.mindstick.com/forum/156551/avatar-designing-through-html-and-css

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
