一.id选择器
#id名 {
属性
}
在标签中属性一栏填写id = “id名
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> 表格 </title>
<style>
#blue {
color:blue;
}
</style>
</head>
<body>
<form>
<label for="name" id="blue">用户名:</label>
<input type = "text" name="username" value="请输入用户名" maxlength="6" id="name"> <br/>
<label for="man">男</label>
<input type="radio" id="man" name="sex">
<label for="woman">女</label>
<input type="radio" id="woman" name="sex">
</form>
</body>
</html>
注:这个id只能调用一次
二.通配符选择器
* {
属性;
}
把所有的标签都进行改变
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> 表格 </title>
<style>
#blue {
color:blue;
}
* {
color: red;
}
</style>
</head>
<body>
<form>
<label for="name" id="blue">用户名:</label>
<input type = "text" name="username" value="请输入用户名" maxlength="6" id="name"> <br/>
<label for="man">男</label>
<input type="radio" id="man" name="sex">
<label for="woman">女</label>
<input type="radio" id="woman" name="sex">
</form>
</body>
</html>