Html 属性标签更改标签颜色

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6199476/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 08:52:07  来源:igfitidea点击:

label for attribute changes color of label

htmlcolorslabel

提问by sij

I used 'for' attribute in label tag in HTML but using that made my lable look grey rather than default black help me to make this black uniformly without using any inline style or giving any special class attribute in each label.

我在 HTML 的标签标签中使用了 'for' 属性,但使用它使我的标签看起来是灰色而不是默认黑色,这有助于我在不使用任何内联样式或在每个标签中提供任何特殊类属性的情况下均匀地制作黑色。

回答by Mr Meow

You could just change the style all labels.

您可以更改所有标签的样式。

label {
color: #000; /* makes the text-black */
}

of you can make it more specific...

你可以让它更具体......

#form-id-here label {
color:#000;
}

That way you can change the labels for a certain form only.

这样,您只能更改特定表单的标签。