问题描述
在所有浏览器中,CSS中的单选按钮的大小是否可以更改?我不知道如何做到这一点。如果你知道这是不可能的,请让我知道,所以我不浪费我的时间。我还没有研究CSS 3的HTML 5。 Hmmmm ...
Can the size of a radio button be changed in CSS--in all browsers that is? I cannot figure out how this can be done. If you know this is not possible, please let me know so I don't waste my time. I have not looked into CSS 3 for HTML 5 yet. Hmmmm...
推荐答案
CSS允许对表单元素进行一些操作,因此您应该能够设置其高度和宽度如同任何元素。但是操作系统和浏览器仍然会对最终输出产生影响。
CSS allows for some manipulation of the form element - so you should be able to set it's height and width as with any element. However the OS and Browser still have an impact on the final output.
这个演示中的代码演示了CSS规则以及如何使用它们来设置单选按钮的样式:
The code in this demo demonstrates CSS rules and how they are used to style the radio buttons:http://www.456bereastreet.com/lab/styling-form-controls-revisited/radio-button/
避免使用CSS的最简单方法 - 这实际上是更难完成此更改的方法 - 是使用javascript和css替换单选按钮和其他表单元素与自定义图像:
The easiest way to avoid using CSS - which is actually the more difficult way to accomplish this change - is to use javascript and css to replace the radio buttons and other form elements with custom images :http://www.emblematiq.com/lab/niceforms/
这篇关于更改单选按钮的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!