programming-examples/css/Attribute Value Selectors for input controls.html

74 lines
2.6 KiB
HTML
Raw Permalink Normal View History

2019-11-15 12:59:38 +01:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml' xml:subLang='en'>
<head>
<title>Attribute Value Selectors for input controls</title>
<style rel='stylesheet' type='text/css'>
input[type='text'] {
background: orange;
color: green;
border: 2px solid blue;
}
input[type='text'][name='last_name'] {
background: aqua;
color: yellowgreen;
border: 2px solid yellowgreen;
}
input[type='password'][name='password'] {
background: white;
color: pink;
border: 2px solid pink;
}
</style>
</head>
<body>
<form method='post' action=''>
<fieldset>
<b>Example Form</b>
<table>
<tbody>
<tr>
<td>
<label for='first-name'>First Name:</label>
</td>
<td>
<input type='text'
name='first_name'
id='first-name'
value=''
size='30' />
</td>
</tr>
<tr>
<td>
<label for='last-name'>Last Name:</label>
</td>
<td>
<input type='text'
name='last_name'
id='last-name'
value=''
size='30' />
</td>
</tr>
<tr>
<td>
<label for='account-password'>Password:</label>
</td>
<td>
<input type='password'
name='password'
id='account-password'
size='30'
value='' />
</td>
</tr>
</tbody>
</table>
</fieldset>
</form>
</body>
</html>