Sarnath India
  • Home
  • NodeJs
  • PHP
  • CSS
  • Javascript
  • Privacy Policy
  • Terms and Conditions
  • Disclaimer
  • DMCA
  • About Us

Subscribe to Updates

Get the latest creative news from FooBar about art, design and business.

What's Hot

How to Install Node.Js on Windows Machine

March 23, 2023

Image/File Upload with Progressbar Using PHP & Jquery

March 1, 2023

Display location on google map from address using javascript google map api

March 1, 2023
Facebook Twitter Instagram
Sarnath India
  • Home
  • NodeJs
  • PHP
  • CSS
  • Javascript
Sarnath India
Home»CSS»How to create rounded profile picture using pure CSS
CSS

How to create rounded profile picture using pure CSS

sarnathindiaBy sarnathindiaFebruary 28, 20232 Mins Read
Facebook Twitter Pinterest LinkedIn WhatsApp Reddit Tumblr Email
How to create rounded profile picture using pure CSS
Share
Facebook Twitter LinkedIn Pinterest Email

A profile picture is one of the most important aspects of an online identity, and having a rounded profile picture can add a more professional touch to your online presence. In this tutorial, we will show you how to create a rounded profile picture using pure CSS.

Step 1: HTML Markup First, let’s create the HTML markup for our profile picture. We will create a container for the profile picture and an image tag inside the container. We will also give the container a class of “profile-pic” so that we can style it with CSS later on.

HTML
<div class="profile-pic">
  <img src="your-profile-picture.jpg" alt="Your Name">
</div>
HTML

Step 2: CSS Styling Now that we have our HTML markup, let’s style it to create a rounded profile picture. We will first give the container a fixed width and height so that it can contain the profile picture. We will also give it a border-radius property of 50% to create a circle shape.

CSS
.profile-pic {
  width: 150px;
  height: 150px;
  border-radius: 50%;
}
CSS

Next, we will style the image inside the container. We will give it a width and height of 100% to fill the container, and we will also give it a border-radius property of 50% to match the container’s shape.

CSS
.profile-pic img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
CSS

Step 3: Optional Styling To further customize your rounded profile picture, you can add additional CSS properties to the container and the image. For example, you can add a border property to the container to create a border around the profile picture, or you can add a box-shadow property to give it a shadow effect.

CSS
.profile-pic {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 2px solid #333;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.profile-pic img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
CSS

Creating a rounded profile picture using pure CSS is a simple and effective way to add a professional touch to your online presence. By following the steps outlined in this tutorial, you can easily create a rounded profile picture that can be customized to fit your needs.

CSS
Share. Facebook Twitter Pinterest LinkedIn WhatsApp Reddit Tumblr Email
sarnathindia
  • Website

My name is Rohit Vadaviya and I am Programmer, Analyst And Blogger based in Baroda, India. I try to share some awesome scripts on my blog which I personally feel are useful for me as well as all developers, programmers and designers while working on any project.

Related Posts

CSS February 28, 2023

CSS Media Queries for All The Common Devices

CSS February 27, 2023

CSS Wave Animation Examples

CSS February 27, 2023

CSS Skeleton Loadings Example + Source Code

Leave A Reply Cancel Reply

Top Posts

How to import excel file into mysql using php

February 26, 202329 Views

How to create chat application using node.js and socket.io

February 26, 202323 Views

Read RSS feed of website (blog) using php

February 27, 202318 Views

Subscribe to Updates

Get the latest tech news from FooBar about tech, design and biz.

Most Popular

How to import excel file into mysql using php

February 26, 202329 Views

How to create chat application using node.js and socket.io

February 26, 202323 Views

Read RSS feed of website (blog) using php

February 27, 202318 Views
Our Picks

How to Install Node.Js on Windows Machine

March 23, 2023

Image/File Upload with Progressbar Using PHP & Jquery

March 1, 2023

Display location on google map from address using javascript google map api

March 1, 2023

Subscribe to Updates

Get the latest creative news from FooBar about art, design and business.

Sarnath India
  • Home
  • About Us
  • Privacy Policy
  • Terms and Conditions
  • Disclaimer
  • DMCA
© 2023 ThemeSphere. Designed by ThemeSphere.

Type above and press Enter to search. Press Esc to cancel.