[whatwg] Placeholder option for text input boxes

Nils Dagsson Moskopp nils-dagsson-moskopp at dieweltistgarnichtso.net
Fri Oct 3 09:51:49 PDT 2008


<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">

    <head>
        <style type="text/css">
            *
            {
                font-size:              12px;
            }

            input
            {
                background-color:       white;
                margin-left:            -1em;
                opacity:                0.5;
                padding:                0.5em;
                vertical-align:         middle;
            }

            input:focus
            {
                opacity:                1.0;
            }

            span
            {
                display:                inline-block;
                margin-left:            0.5em;
                height:                 2em;
                width:                  0;
            }
        </style>
    </head>

    <body>
        <form>
            <fieldset>
                <legend>no placeholder attribute necessary</legend>
                <label for="input">
                    <span>amirite?</span>
                    <input type="text" id="input"/>
                </label>
            </fieldset>
        </form>
    </body>

</html>




More information about the whatwg mailing list