cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <!-- Experimental, for a while I searched how to create a transitional gradient hover effect on text but could not find a solution. So here I am using mix-blend-mode to screen to make the text see through. Then the div behind it will have the graident and I set this div to width: 0% to then on hover width: 100% causing it to look like the text has a gradient applied to it. -->

<!-- when using this for varied widths - use white-space: no-wrap; on the h1 and remove widths from outer & inner -->

<div class="outer">
  <div class="bg">
    <div class="inner">

      <h1> GRADIENT TEXT ON HOVER</h1>

    </div>
  </div>
</div>
            
          
!
            
              body {
  background-color: grey;
  font-family: helvetica;
}

.outer {
  padding-top: 120px;
  width: 850px;
  margin: auto;
  display: block;
  /* set the font color here as a background color, in this case black
  background-color: black; */
 
}

.bg {
  text-align: center;
  width: 0%;
  transition: all 0.6s ease-out;
  background: #3ebac6 background: -moz-linear-gradient(left, #3ebac6 0%, #8b539e 50%, #e53782 100%);
  background: -webkit-gradient(linear, left top, right top, color-stop(0%, #3ebac6), color-stop(50%, #8b539e), color-stop(100%, #e53782));
  background: -webkit-linear-gradient(left, #3ebac6 0%, #8b539e 50%, #e53782 100%);
  background: -o-linear-gradient(left, #3ebac6 0%, #8b539e 50%, #e53782 100%);
  background: -ms-linear-gradient(left, #3ebac6 0%, #8b539e 50%, #e53782 100%);
  background: linear-gradient(to right, #3ebac6 0%, #8b539e 50%, #e53782 100%);
  filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#3ebac6', endColorstr='#e53782', GradientType=1);
}

.inner {
  display: inline-block;
  background-color: white;
  mix-blend-mode: screen;
  padding: 5px;
  width: 850px;
}

h1 {
  color: black;
  font-size: 50px;
  letter-spacing: 5px;
}

.outer:hover .bg {
  width: 100%;
}
            
          
!
999px
Loading ..................

Console