User Profile Card using HTML CSS

User Profile Card using HTML CSS

HTML

<div class="container">
 <div class="profileCard">
  <div class="imgContainer">
     <img src="profile.jpg" alt="">
   </div>
   <div class="infoContainer">
     <h2 class="text-center my-10">Hi!, i'm JohnDoe</h2>
     <h4 class="text-center my-10">Developer</h4>
   </div>
  </div>
</div>

SCSS

@import url('https://fonts.googleapis.com/css?family=Delius+Swash+Caps');
*{
  font-family: 'Delius Swash Caps', cursive;
}
@function rem($value) {
  @return unquote(($value/1px)/16+"rem");
}

$yellow:#fbbc13;
$pink:#f71236;
$violet:#791eff;
$speed:2s;
body{
  background-color: #212121;
}

.container{
  position:fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin:auto;
  display: flex;
  justify-content: center;
  align-items: center;
}
$white:#ffffff;
$imgBackground:#08aeac;
*{
  box-sizing:border-box;
}
.profileCard{
  background-color: $white;
  padding:20px;
  border-radius:50% 50% 50% 50% / 19% 19% 81% 81%;
  margin:10px;
  .imgContainer{
    background-color: $imgBackground;
    padding:20px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius:500px;
    overflow:hidden;
    border-radius:50% 50% 50% 50% / 19% 19% 81% 81%;
    img{
      max-width:100%;
      width: 300px;
      border-radius:inherit;
      border:rem(2px) solid $white
    }
  }
}

.text-center{
  text-align:center !important;
}
.my-10{
  margin-top:rem(10px);
  margin-bottom:rem(10px);
}

.article{
  display: flex;
  justify-content: space-between;
  position:absolute;
  top: 0;
  left: 0;
  right: 0;
  margin:auto;
  a{
    color:$white;
  }
}

CSS

@import url("https://fonts.googleapis.com/css?family=Delius+Swash+Caps");
* {
  font-family: "Delius Swash Caps", cursive;
}

body {
  background-color: #212121;
}

.container {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

* {
  box-sizing: border-box;
}

.profileCard {
  background-color: #ffffff;
  padding: 20px;
  border-radius: 50% 50% 50% 50%/19% 19% 81% 81%;
  margin: 10px;
}
.profileCard .imgContainer {
  background-color: #08aeac;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 500px;
  overflow: hidden;
  border-radius: 50% 50% 50% 50%/19% 19% 81% 81%;
}
.profileCard .imgContainer img {
  max-width: 100%;
  width: 300px;
  border-radius: inherit;
  border: 0.125rem solid #ffffff;
}

.text-center {
  text-align: center !important;
}

.my-10 {
  margin-top: 0.625rem;
  margin-bottom: 0.625rem;
}

.article {
  display: flex;
  justify-content: space-between;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin: auto;
}
.article a {
  color: #ffffff;
}

 

Add a Comment

Your email address will not be published. Required fields are marked *