css - 在 CSS 的类中选择类型元素

标签 css html class

您好,我正在尝试设置“type="radio"”元素的样式,但在 CSS 中访问该元素时遇到问题。请帮忙,谢谢。

HTML

<label class="questionLabel"><input class="questionInput" type="radio" name="q4" value="Strongly disagree">

CSS

.questionnaireInput radio    {

    width: 25px;
}

最佳答案

您可以使用属性选择器(假设您在类名为“questionInput”的 radio 之后):

.questionInput[type=radio]{
    width: 25px;
}

关于css - 在 CSS 的类中选择类型元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55034608/

相关文章:

android - 对 Activity 和类(class)感到困惑

css - Symfony2 Twig 模板 - CSS 未加载

javascript - 转义字符不适用于 innerHTML

html - 如何在标题中垂直居中文本?

html - Google Fonts 如何与 Outlook 2013 中的 HTML 使用react?

html - Google Chrome &lt;input/> 自动填充背景颜色在版本 72.0 中是否发生了变化?

java - 我什么时候应该在方法中使用它?

php - 在类中使用数组遍历

javascript - 如何通过点击(Angular 5+)制作横幅广告?

html - Fontawesome 的旧图标列表