CSS3 > Selectors

Enabled selector in CSS3

How to apply style fo editable input text element of HTML in CSS3?


By using Enabled selector we can create the editable input text element of HTML. This is mostly used on form elements.

<style>
        input[type=text]:enabled {
            background: lightgreen;
        }
</style>

<body>
    <form>
        <fieldset>
            <legend>Enter Details</legend>
            Username
            <input type="text" value="Username(enabled)" /><br />
            Password
            <input type="Text" value="password(enabled)" />
            <br />
            Enabled Text
            <input type="text" value="Sheo Narayan" />
        </fieldset>
    </form>
</body>

In the above code snippet enabled is applied to all the <input> element, the content inside the input text boxes is editable. We can edit and rewrite in the text boxes. That is shown clearly in the DEMO URL.

 OUTPUT


 Views: 3604 | Post Order: 14



Write for us






Hosting Recommendations