[whatwg] Placeholder option for text input boxes

<!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>

Received on Friday, 3 October 2008 09:51:49 UTC