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 Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

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.

              %h1 Background Effect on Forms
%p Please focus on every text field in order!

<input type="text" id="first">
<input type="text" id="second">
<input type="text" id="third">
<input type="text" id="fourth">
<input type="text" id="fifth">
              .background { position:absolute; top:0; bottom:0; left:0; right:0; background-color:tomato; z-index:-1; background-blend-mode:multiply; background-size:cover; transition:all .5s; transition-delay:.5s; background-image:url('http://lorempixel.com/animals/1100/800'); }

input[type=text] { width:60%; margin-bottom:20px; margin:0 auto 20px auto; left:0; right:0; z-index:10; display:block; border-radius:5px; border:1px solid black; background-color:rgba(255, 255, 255, .5); height:30px; padding:10px; &:first-of-type { margin-top:40px; } &:focus { background-color:white; outline:none; ~ .background {
      transition-delay: 0;
    } } }

#first:focus ~ .background { background-image:url('http://lorempixel.com/sports/1100/800'); background-color:darkseagreen; }
#second:focus ~ .background { background-image:url('http://lorempixel.com/nature/1100/800'); background-color:teal; }
#third:focus ~ .background { background-image:url('http://lorempixel.com/fashion/1100/800'); background-color:floralwhite; }
#fourth:focus ~ .background { background-image:url('http://lorempixel.com/food/1100/800'); background-color:lightsalmon; }
#fifth:focus ~ .background { background-image:url('http://lorempixel.com/abstract/1100/800'); background-color:lightpink; }

h1, p { color:white; text-align:center; text-shadow: 1px 1px black; }

/*Backgrounds preload*/

    content: url('http://lorempixel.com/sports/1100/800') url('http://lorempixel.com/nature/1100/800') url('http://lorempixel.com/fashion/1100/800') url('http://lorempixel.com/food/1100/800')
              //Look Ma! No JS!

// Thanks Gregor Adams (@pixelass) for suggesting transitioning the whole background! Much smoother!
Loading ..................