CSS同一字段的两种不同样式 [英] CSS Two different styles for the same field

查看:154
本文介绍了CSS同一字段的两种不同样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在同一个栏位中套用两种样式?一个名称*字段。我想将名称应用为一种文本颜色,*是另一种颜色。任何一个建议。

How can i apply two styles in the same field? One Name* field.I want to apply Name as one text color and * are another color.Can any one suggest.

推荐答案

我想你在同一个元素中要求两种不同的文字颜色 - 你不能这样做。您需要在其中添加其他元素,例如:

I think you're asking for two different text colours within the same element - you can't do that. You need to add another element in there, for example:

<label for="first_name">Name<span>*</span></label>

label { color: blue; }
label span { color: red; }

这篇关于CSS同一字段的两种不同样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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