现在的位置: 首页 > 综合 > 正文

单选框样式示例

2013年09月20日 ⁄ 综合 ⁄ 共 742字 ⁄ 字号 评论关闭

 HTML+CSS  多选、单选框样式示例

1.使用clip:rect():
<body>
this is a checkbox
<input type="checkbox" style="position:absolute;clip:rect(5,14,14,5);background:red" id="myCheckbox">
<span style="position:absolute;border:solid 1px blue;width:9px;height:9px;left:expression(myCheckbox.offsetLeft+5);top:expression(myCheckbox.offsetTop+5)"><!-- --></span>
</body>

2.基本样式:

<br>单选和复选按钮的背景是红色的<br>
<input type="checkbox" name="checkbox" value="checkbox" style="background-color: #FF0000;border:1px dashed lime;">
<input type="radio" name="radiobutton" value="radiobutton" style="background-color: #FF0000"> 

3.CSS样式:

<style>.mycheckbox{position:absolute;clip: rect(6 17 17 6);}</style>
<input type=checkbox  class='mycheckbox'>&nbsp;&nbsp;&nbsp;&nbsp;this is a Checkbox

抱歉!评论已关闭.