Created
May 11, 2018 06:15
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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