如何在css中选择单选按钮? [英] How do you select a radio button in css?

查看:154
本文介绍了如何在css中选择单选按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在CSS中选择单选按钮?我使用的HTML是生成的,所以我不能添加类或其他属性。

How do you select a radio button in CSS? The HTML I am working with is generated so I cannot add class or other attributes to it.

我在互联网上找到输入[type =radio],但我不知道这是否是常规的CSS,并且支持大多数浏览器。

I found input[type="radio"] on the internet, but I don't know if this is regular CSS and supported by most browsers.

有没有其他方法可以选择单选按钮?

Is there any other ways to select a radio button?

谢谢,

Brett

推荐答案

input [type =radio] 属性选择器的示例。它是CSS3规范的一部分,是完全合法的。唯一不支持它们的浏览器是IE6。如果支持IE6对项目很重要,那么您应该考虑向相关单选按钮添加类。

input[type="radio"] is an example of an attribute selector. It's part of the CSS3 spec and is perfectly legal. The only browser that doesn't support them is IE6. If supporting IE6 is important to the project, then you should look into adding classes to the radio buttons in question.

这里有一篇文章,介绍如何有效地使用属性选择器。请查看此文章有关CSS3好东西的更多信息。

Here's an article with an example of how to effectively use attribute selectors. Check out this article for more info on CSS3 goodies.

这篇关于如何在css中选择单选按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆