Skip to content

Instantly share code, notes, and snippets.

@ashinzekene
Created May 11, 2018 06:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashinzekene/5001c208f7ecf164721defd3f4103313 to your computer and use it in GitHub Desktop.
Save ashinzekene/5001c208f7ecf164721defd3f4103313 to your computer and use it in GitHub Desktop.
To create a square object without specifying the width and height in pixels
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.profile-image {
width: 80%;
padding-bottom: 80%;
margin: 10px auto;
height: 0;
position: relative;
}
.profile-image img {
border-radius: 50%;
height: 100%;
width: 100%;
position: absolute;
}
</style>
</head>
<body>
<div class="profile-image">
<img src="http://stuffpoint.com/imvu/image/341920-imvu-stylish-avatar.png" alt="">
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment