Skip to content

Instantly share code, notes, and snippets.

@AhmedHelalAhmed
Last active April 29, 2021 20:38
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 AhmedHelalAhmed/83f899c431f48c077b466d2638e35a69 to your computer and use it in GitHub Desktop.
Save AhmedHelalAhmed/83f899c431f48c077b466d2638e35a69 to your computer and use it in GitHub Desktop.
challenge in tailwindcss
<div class="relative cursor-pointer">
<div class="h-24 w-24 rounded-full z-30 absolute bg-opacity-50 transition duration-1000 hover:bg-green-700"></div>
<img src="https://picsum.photos/200" class="rounded-full h-24 w-24" alt="image"/>
</div>
@AhmedAbdElfatahAhmed
Copy link

AhmedAbdElfatahAhmed commented Apr 29, 2021

Hello this my Html and Css code

first:HTml
<div class="myImage"> <div class="overlay"></div> <img src="images/work-1.jpg" alt="" /> </div>

second:Css

.myImage {
  width: 150px;
  height: 150px;
  position: relative;
  cursor: pointer;
}
.myImage img,
.myImage .overlay {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  -ms-border-radius: 50%;
  -o-border-radius: 50%;
}
.myImage .overlay {
  background-color: transparent;
  position: absolute;
  transition: 2s background-color;
  -webkit-transition: 2s background-color;
  -moz-transition: 2s background-color;
  -ms-transition: 2s background-color;
  -o-transition: 2s background-color;
}

.myImage .overlay:hover {
  background-color: rgb(0, 128, 0, 0.8);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment