今天小编给大家分享的是怎么在html页面中调用外部样式,相信很多人都不太了解,为了让大家更加了解,所以给大家总结了以下内容,一起往下看吧。一定会有所收获的哦。两种调用方法:1、使用link标签调用,语
顺晟科技
2022-09-15 21:38:11
125
<!DOCTYPE html >
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>更换单选按钮显示样式</title>
<style>
input[type=\'radio\'].radio {opacity:0; display:inline-block; height:20px; }
label.radio {background:url(img/kugou.ico) no-repeat; height:20px; padding-left:25px;}
input[type=\'radio\'].radio:checked + .radio {background:url(img/qqplayer.ico) no-repeat;}
</style>
</head>
<body>
<input type="radio" name="gender" id="x" value="X"><label for="x">我要保密</label><br>
<input type="radio" name="gender" id="y" value="M"><label for="y">我是帅哥</label><br>
<input type="radio" name="gender" id="z" value="F"><label for="z">我是美女</label><br>
<input type="radio" name="sex" id="a" value="X" class="radio">
<label for="a" class="radio">我要保密</label><br>
<input type="radio" name="sex" id="b" value="M" class="radio">
<label for="b" class="radio" >我是帅哥</label><br>
<input type="radio" name="sex" id="c" value="F" class="radio">
<label for="c" class="radio" >我是美女</label><br>
</body>
</html>

<!DOCTYPE html >
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>更换单选按钮显示样式</title>
<style>
.radio {opacity:0; display:inline-block; height:20px; }
label.label {background:url(img/kugou.ico) no-repeat; height:20px; padding-left:25px;}
input[type=\'radio\'].radio:checked + .label{background:url(img/qqplayer.ico) no-repeat;}
</style>
</head>
<body>
<input type="radio" name="gender" id="x" value="X"><label for="x">我要保密</label><br>
<input type="radio" name="gender" id="y" value="M"><label for="y">我是帅哥</label><br>
<input type="radio" name="gender" id="z" value="F"><label for="z">我是美女</label><br>
<input type="radio" name="sex" id="a" value="X" class="radio">
<label for="a" class="label">我要保密</label><br>
<input type="radio" name="sex" id="b" value="M" class="radio">
<label for="b" class="label" >我是帅哥</label><br>
<input type="radio" name="sex" id="c" value="F" class="radio">
<label for="c" class="label" >我是美女</label><br>
</body>
</html>
19
2022-10
19
2022-10
25
2022-09
16
2022-09
15
2022-09
15
2022-09