6

.mouse-out - another hover effect

 1 year ago
source link: https://codepen.io/EricPorter/pen/abqvJaV
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
0 unsaved changes
xxxxxxxxxx
<section>
  <p class="mouse-out">Mouse Out</p>
</section>
<section>
  <p class="mouse-out mouse-out-left">Mouse Out Left</p>
</section>
<section>
  <p class="mouse-out mouse-out-up">Mouse Out Up</p>
</section>
<section>
  <p class="mouse-out mouse-out-down">Mouse Out Down</p>
</section>

CSS (SCSS)

CSS (SCSS)

xxxxxxxxxx
$font-size: 3rem;
.mouse-out {
  position: relative;
  transition: 0.3s;
  color: #fff;
  &:hover {
    color: #000;
  }
  &::before {
    content: " ";
    background: #fff;
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0 0 0 0;
    z-index: -1;
    transition: transform 0.3s;
    transform: scale(0, 1);
    transform-origin: bottom right;
  }
xxxxxxxxxx

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK