Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please type your username.

Please type your E-Mail.

Please choose an appropriate title for the post.

Please choose the appropriate section so your post can be easily searched.

Please choose suitable Keywords Ex: post, video.

Browse

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Navigation

  • Home
  • About Us
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Contact Us
Home/ Questions/Q 5021

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Latest Questions

Author
  • 61k
Author
Asked: November 27, 20242024-11-27T05:23:06+00:00 2024-11-27T05:23:06+00:00

Beautiful goldish avatar using only one element – A step-by-step tutorial

  • 61k

Tutorial on how to create a beautiful golden avatar using only one element.

Goldish Avatar

HTML

For HTML, we need only one div element with class “avatar”.

<div class="avatar"></div> 
Enter fullscreen mode Exit fullscreen mode

CSS
For CSS, first we'll style the “avatar” class.

We'll set width and height of 100×100 pixels with border set to 10px goldish solid.

I'll just set a background image that I found on google and set the size to cover.

To form a circle, simply set border-radius property to 50%.
Lastly, we'll set position to relative.

.avatar {     width: 100px;     height: 100px;     border: 10px solid #d0ab35;     background-image: url('https://dl.memuplay.com/new_market/img/com.vicman.newprofilepic.icon.2022-06-07-21-33-07.png');     background-size: cover;     border-radius: 50%;     position: relative; } 
Enter fullscreen mode Exit fullscreen mode

Now we'll style the before pseudo element.

We'll set content and position to absolute with top, bottom, left and right set to -16 pixels.

This means that this element will be by 16 pixels larger on all sides that the div “avatar” element.

We'll set border radius to 50% to form a circle.

Now we'll set background image to linear gradient with some beautiful golden colors.

Using clip-path property, we'll create cut two squares, one on top and one on the right side.

By setting z-index property to -1, this element will go beneath the “avatar” div element, and it will look like a 16 pixels wide border.

.avatar:before {     content: "";     position: absolute;     top: -16px;     bottom: -16px;     left: -16px;     right: -16px;     border-radius: 50%;     background-image: linear-gradient(to right, #BF953F, #FCF6BA, #B38728, #FBF5B7, #AA771C);     clip-path: polygon(54% 0, 53% 5%, 59% 6%, 61% 0, 100% 0, 100% 60%, 94% 58%, 91% 67%, 100% 70%, 100% 100%, 0 100%, 0 0);     z-index: -1; } 
Enter fullscreen mode Exit fullscreen mode

Now we'll style the after pseudo element.
We'll set content and position to absolute with top, bottom, left and right set to -11 pixels.
This means that this element will be larger that 11 pixels on all sides that “avatar” div element, and 5 pixels smaller that the before pseudo element.
We'll just set solid white border to 4 pixels with radius of 50% to form a circle.

.avatar:after {     content: "";     position: absolute;     top: -11px;     bottom: -11px;     left: -11px;     right: -11px;     border: 4px solid #fff;     border-radius: 50%; } 
Enter fullscreen mode Exit fullscreen mode

And that's it.

You can find video tutorial and full code here.

Thanks for reading. ❤️

csshtmltutorialwebdev
  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 4k
  • Answers 0
  • Best Answers 0
  • Users 2k
  • Popular
  • Answers
  • Author

    ES6 - A beginners guide - Template Literals

    • 0 Answers
  • Author

    Understanding Higher Order Functions in JavaScript.

    • 0 Answers
  • Author

    Build a custom video chat app with Daily and Vue.js

    • 0 Answers

Top Members

Samantha Carter

Samantha Carter

  • 0 Questions
  • 20 Points
Begginer
Ella Lewis

Ella Lewis

  • 0 Questions
  • 20 Points
Begginer
Isaac Anderson

Isaac Anderson

  • 0 Questions
  • 20 Points
Begginer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore, ask, and connect. Join our vibrant Q&A community today!

About Us

  • About Us
  • Contact Us
  • All Users

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Help

  • Knowledge Base
  • Support

Follow

© 2022 Querify Question. All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.