<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.radio-btn + label {
display: block;
width: 20px;
height: 20px;
border-radius: 50%;
background: transparent;
border: 1px solid black;
cursor: pointer;
position: relative;
top: -11px;
margin: 0 5px 0;
}
.radio-btn:checked + label::after {
content: "\2714";
font-size: 14px;
line-height: 14px;
text-align: center;
color: #000000;
position: absolute;
left: 4px;
}
.radio-btn {
opacity: 0;
}
</style>
</head>
<body>
<div>
<input
id="item1"
type="radio"
name="item1"
value="艺术创作个人/团体"
class="radio-btn"
v-model="picked"
/>
<label for="item1" class="txt"></label>
</div>
<div>
<input
id="item"
type="radio"
name="item1"
value="艺术创作个人/团体"
class="radio-btn"
v-model="picked"
/>
<label for="item" class="txt"></label>
</div>
</body>
</html>
以上代码的运行结果是
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.radio-btn + label {
display: block;
width: 20px;
height: 20px;
border-radius: 50%;
background:rgba(255,255,255,1);
border:2px solid rgba(201,201,201,1);
cursor: pointer;
position: relative;
top: -11px;
margin: 0 5px 0;
}
.radio-btn:checked + label::after {
content: "";
font-size: 14px;
line-height: 14px;
text-align: center;
color: #000000;
position: absolute;
left: 3px;
top: 2px;
width: 15px;
height: 15px;
border-radius: 50%;
background-color: #7ECEF4;
}
.radio-btn {
opacity: 0;
}
</style>
</head>
<body>
<div>
<input
id="item1"
type="radio"
name="item1"
value="艺术创作个人/团体"
class="radio-btn"
v-model="picked"
/>
<label for="item1" class="txt"></label>
</div>
<div>
<input
id="item"
type="radio"
name="item1"
value="艺术创作个人/团体"
class="radio-btn"
v-model="picked"
/>
<label for="item" class="txt"></label>
</div>
</body>
</html>
如果是这样子的话,运行结果是: