【发布时间】:2014-06-03 10:24:42
【问题描述】:
我按照 stackoverflow 上的提示创建了一个单选按钮 css,但缺少一些细节。
它打印出一个红色方块而不是默认的单选按钮图标,但是当我单击它时,什么也没有发生。
有代码: 在 for 循环中我有:
$radioprint[$j] .= '<div class="radio"><div><input type="radio" name="radio'.$j.'" value="'.$radioarr[$j][$r].'">
<label for="radio'.$j.'"></label>'.$radioarr[$j][$r].'</div></div>';
我调整了css:
input[type=radio]{display:none;}
label {
width: 14px;height: 14px;display: inline-block;background-color: red;cursor: pointer;
}
input[type=radio]:checked + label {
width: 14px;height: 14px;display: inline-block;background-color: green;cursor: pointer;
}
【问题讨论】:
标签: php css radio-button