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.

              <div class="container">
    <h2>Style-able Input Placeholder</h2>
    <label for="">
        <input type="text">
    <label for="" class="underline">
        <input type="text">
    <label for="" class="bold">
        <input type="text">
              .container {
    text-align: center;

.container > h2 {
    font-family: sans-serif;
    text-align: center;

label {
    position: relative;

input {
    padding: 4px 6px;

label:after {
    content: "Search";
    position: absolute;
    padding-left: 6px;
    font-family: sans-serif;
    font-size: 14px;
    color: #999;
    opacity: 0.9;
    top: 2px;
    left: 2px;
    cursor: text;

label.underline:after {
    text-decoration: underline;

label.bold:after {
    font-weight: bold;

label.hide-placeholder:after {
    content: "";
 * Ya'll asked for Style-able Placeholders that work in IE8+
 * So here's some JS too (jQuery is purely optional).
 * Go on purists, make it vanilla JS.

var $input = $('input'),
    $label = $input.parent();

// Need this handler as clicking on pseudo ::after won't focus textbox directly.
$label.on('click', function(e) {

// If user types something, hide placeholder.
$input.on('input', function(e) {
    if ($(this).val())
Loading ..................