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.

            
              <div id="wrapper">
  <div class="text">
    <h1>Eltern von Elementen mit Fokus hervorheben</h1>
<p>Dieses Beispiel zeigt die Pseudoklasse <em>:focus-within</em> in der Praxis. Siehe den dazugehörigen Artikel bei den <a href="http://webkrauts.de/artikel/2018/focus-within">Webkrauts</a>. Dieser Text wird in den Hintergrund treten, sobald das Formular verwendet wird.</p></div>
  
<form action="#">
    <h2>Das Formular</h2>
  
  <fieldset>
    <label id="name-label" for="name">Dein Name</label>
    
      <input id="name" name="name" type="text"   />

    <label id="email-label" for="email">
      Deine E-Mail
    </label>
    
      <input id="email" name="email" type="email"   /> 
 </fieldset>
    
  <fieldset>
    <label id="label-message" for="message">
      Deine Nachricht
    </label>
  

      <textarea id="message" name="message" rows="8" cols="48"></textarea>

  </fieldset>
  
        <input id="submit" type="submit" value="Senden">

</form>
</div>
            
          
!
            
              
body {
  background: #dddddd url(http://webkrauts.de/sites/all/themes/webkrauts/img/webkrauts_background.png);
}

h1, h2 {
  margin-top: 0;
}

#wrapper{
  background: white;
  width: 80%;
  max-width: 600px;
  margin: 20px auto;
  padding: 30px;
}

#wrapper:focus-within .text {
  opacity: 0.3;
}

#wrapper form {
  padding: 20px;
  margin-top: 20px;
}

#wrapper:focus-within form {
  background: #eee;
}

form fieldset {
  padding: 20px;
  border: 3px solid transparent;
}

form fieldset:focus-within {
  background: #FFF;
}

form label {
  display: block;
  margin-bottom: 5px;
}

form input, form textarea {
  width: calc(100% - 20px);
  margin-bottom: 20px;
  border: 1px solid #AAA;
  padding: 10px;
}

form input:focus, form textarea:focus {
  border: 3px solid #333;
  padding: 8px;
}

#submit {
  width: auto;
  margin: 20px 0 0 23px;
}

#submit:hover, #submit:focus {
  background-color: #333;
  color: #FFF;
}
            
          
!
999px
Loading ..................

Console