Using Psuedo element's CSS hover effect to overlap the main element
P粉838563523
P粉838563523 2024-03-20 10:31:28
0
1
319

Basically, when I hover, I want the effect to look like this:

My website is here

The code is as followsIgnore! important:

.cta-button-menu, .cta-button-menu::before {
        transition:all 0.3s linear !important;
        width: 120px !important;
        height: 50px !important;
        display: inline-flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
    .cta-button-menu:hover {
        transform:rotateZ(-45deg) !important;
        background: #21B6CD !important;
        color: white !important;
    }
    .cta-button-menu::before {
        content:"Book Now" !important;
        background-color:transparent !important;
        position:absolute !important;
        @include main-font($white, 16px !important, $font-bold !important);
      }
    .cta-button-menu:hover::before{
        transform: rotateZ(90deg) !important;
        background-color:#e72f54 !important;
        border:none !important;
    }

For some reason I can't get the blue button to overlap the red button. Can't figure it out

P粉838563523
P粉838563523

reply all(1)
P粉021708275

交换 .cta-button-menu:hover set background: #e72f54.cta-button-menu:hover::before set background-color:#21B6CD 中的颜色。并且还要改变度数。希望这对你有用

ul {
margin-top: 60px;
}
.cta-button-menu,
    .cta-button-menu::before {
      transition: all 0.3s linear !important;
      width: 120px !important;
      height: 50px !important;
      display: inline-flex !important;
      justify-content: center !important;
      align-items: center !important;
    }

    .cta-button-menu:hover {
      transform: rotateZ(45deg) !important;
      background: #e72f54 !important;
      color: white !important;

    }

    .cta-button-menu::before {
      content: "Book Now" !important;
      background-color: transparent !important;
      position: absolute !important;
      @include main-font($white, 16px !important, $font-bold !important);
    }

    .cta-button-menu:hover::before {
      transform: rotateZ(-90deg) !important;
      background-color: #21B6CD !important;
      border: none !important;

    }




Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template