如何使单选按钮在选择一个选项(CSS)后显示为选中状态
How can i make a radio button appear checked after selecting an option (CSS)
当我将鼠标悬停在选项的文本上并选择它时,应该会选中单选按钮。这样,当我选择标签时,复选框将显示为选中。
我应该添加标签还是将td
作为按钮?
.zui-table {
border: solid 1px #DDEEEE;
border-collapse: collapse;
border-spacing: 0;
font: normal 13px Arial, sans-serif;
}
.zui-table thead th {
background-color: #DDEFEF;
border: solid 1px #DDEEEE;
color: #336B6B;
padding: 10px;
text-align: left;
text-shadow: 1px 1px 1px #fff;
}
.zui-table tbody td {
border: solid 1px #DDEEEE;
color: #333;
padding: 10px;
text-shadow: 1px 1px 1px #fff;
}
.zui-table-rounded {
border: none;
}
.zui-table-rounded thead th {
background-color: #CFAD70;
border: none;
text-shadow: 1px 1px 1px #ccc;
color: #333;
float: center;
}
.zui-table-rounded thead th:first-child {
border-radius: 10px 0 0 0;
}
.zui-table-rounded thead th:last-child {
border-radius: 0 10px 0 0;
}
.zui-table-rounded tbody td {
border: none;
border-top: solid 1px #957030;
background-color: #EED592;
}
.zui-table-rounded tbody tr:last-child td:first-child {
border-radius: 0 0 0 10px;
}
.zui-table-rounded tbody tr:last-child td:last-child {
border-radius: 0 0 10px 0;
}
<table class="zui-table zui-table-rounded" align="center">
<thead>
<tr>
<th colspan="4">1.Look at this series: 7, 10, 8, 11, 9, 12, ... What number should come next?</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="radio" name="question1" value="lr0101">7</td>
<td><input type="radio" name="question1" value="lr0102">10</td>
<td><input type="radio" name="question1" value="lr0103">12</td>
<td><input type="radio" name="question1" value="lr0104">13</td>
<!--Option b-->
</tr>
</tbody>
</table>
使用标签-我想您实际上并不想在悬停文本时选择?
像这个
<td><label><input type="radio"
name="question1" value="lr0101">7</label>/td>
或者像这个
<td><input type="radio" id="answerswer1"
name="question1" value="lr0101"><label
for="answerswer1">7</label>/td>`
相关文章:
- 将js添加到wordpress中以突出显示css活动菜单
- 如何在 javascript 替换新图像/标题后正确显示 css 工具提示
- 在页面加载时显示 css(如果已选中)
- Javascript更改显示CSS
- .submit JS函数在Safari中不显示CSS覆盖(除非我取消页面加载)
- Angular 1.2.x ng隐藏和ng显示css转换
- Xcode-UIWebview不显示CSS、Javascript或外部内容
- 让垂直滚动条始终显示 css
- Aptana Studio 3 - SFTP - 预览不显示 CSS/JS.怎么了
- 显示 CSS 样式表时出现 IE8 问题
- 在 Y 屏幕位置显示 CSS 动画
- 根据代码中存在的单词/URL 显示 CSS/HTML
- 未显示 CSS 背景颜色
- 在SVG中显示CSS图像精灵,而不使用外来对象
- 突出显示 CSS 菜单栏中当前选定的链接
- 浏览器预览仅显示html,不显示css或javascript(w3layouts.com 网站模板)
- 使用 PHP 中的 get url 显示 css 样式
- 幻灯片显示css布局干扰html正文
- 禁用在浏览器中显示.css和.js文件的内容
- 文本框'弹出窗口'在鼠标悬停/悬停上显示CSS/Javascript