Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
            
- /css/selectors/selector-required.html - WPT Dashboard Interop Dashboard
 
 
<!DOCTYPE html>
<html>
	<head>
		<title>CSS level4 Selector :required and :optional</title>
		<link rel="author" title="LEE YUN HEE" href="mailto:zzirasi@gmail.com">
		<meta name="assert" content="You should see a green input box.">
        <link rel="match" href="selector-required-ref.html">
		<style>
			input {border:3px solid red;}
			:required {border-color:green;}
			:optional {border-color:green;}
		</style>
	</head>
	<body>
		<p>
			You should see a green input box.
		</p>
        <p>
        	<input required>
        </p>
        <p>
        	<input optional>
        </p>
    </body>
</html>