我的html里面有一个标签<i> 。 我已经在HTML中的所有<a>标签中应用了一些样式。 但我想分隔<i>标签中的任何<a>标签。 我该怎么做?
a.aCategory:link { color: #000000; font-family: Arial; font-size: 12px; font-weight: bold; } a.aCategory:visited { color: #999999; text-decoration: none; font-family: Arial; font-size: 12px; font-weight: bold; } a.aCategory:active { color: #000000; text-decoration: none; font-family: Arial; font-size: 12px; font-weight: bold; } a.aCategory:hover { color: #999999; text-decoration: none; font-family: Arial; font-size: 12px; font-weight: bold; } a.aSubCategory:link { color: #000000; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } a.aSubCategory:visited { color: #999999; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } a.aSubCategory:active { color: #000000; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } a.aSubCategory:hover { color: #999999; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } a:link { color: #3B73B9; text-decoration: none; } a:visited { color: #3B73B9; text-decoration: none; } a:active { color: #3B73B9; text-decoration: none; } a:hover { color: #064D6E; text-decoration: underline; }谢谢。
I have a tag in my html inside <i>. I am already applying some styles to all <a> tags in my HTML. But i would like to separate any <a> tag which is in an <i> tag. How can I do it?
a.aCategory:link { color: #000000; font-family: Arial; font-size: 12px; font-weight: bold; } a.aCategory:visited { color: #999999; text-decoration: none; font-family: Arial; font-size: 12px; font-weight: bold; } a.aCategory:active { color: #000000; text-decoration: none; font-family: Arial; font-size: 12px; font-weight: bold; } a.aCategory:hover { color: #999999; text-decoration: none; font-family: Arial; font-size: 12px; font-weight: bold; } a.aSubCategory:link { color: #000000; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } a.aSubCategory:visited { color: #999999; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } a.aSubCategory:active { color: #000000; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } a.aSubCategory:hover { color: #999999; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } a:link { color: #3B73B9; text-decoration: none; } a:visited { color: #3B73B9; text-decoration: none; } a:active { color: #3B73B9; text-decoration: none; } a:hover { color: #064D6E; text-decoration: underline; }Thanks.
最满意答案
第一件事是在标签内添加不同的风格我只使用'ia'代表所有后代,或者'i> a'代表i的直接孩子。
第二件事是你应该在为所有标签编写的样式之后编写此样式。
a.aCategory:link { color: #000000; font-family: Arial; font-size: 12px; font-weight: bold; } i a.aCategory:link{ //enter your style here } a.aCategory:visited { color: #999999; text-decoration: none; font-family: Arial; font-size: 12px; font-weight: bold; } i a.aCategory:visited{ //enter your style here } a.aCategory:active { color: #000000; text-decoration: none; font-family: Arial; font-size: 12px; font-weight: bold; } i a.aCategory:active{ //enter your style here } a.aCategory:hover { color: #999999; text-decoration: none; font-family: Arial; font-size: 12px; font-weight: bold; } i a.aCategory:hover{ //enter your style here } a.aSubCategory:link { color: #000000; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } i a.aSubCategory:link{ //enter your style here } a.aSubCategory:visited { color: #000000; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } i a.aSubCategory:visited{ //enter your style here } a.aSubCategory:active { color: #000000; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } i a.aSubCategory:active{ //enter your style here } a.aSubCategory:hover { color: #000000; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } i a.aSubCategory:hover{ //enter your style here } a:link { color: #000000; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } i a:link{ //enter your style here } a:visited { color: #000000; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } i a:visited{ //enter your style here } a:active { color: #000000; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } i a:active{ //enter your style here } a:hover { color: #000000; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } i a:hover{ //enter your style here }注意:在上面的代码中,如果您想要仅为子标签应用不同的样式,如果我标记,则使用i> a代替。
First thing is to add different style to a tag inside i just use 'i a' for all descendant or 'i > a' for direct child a of i.
Second thing is you should write this style after style you have written for all a tag.
a.aCategory:link { color: #000000; font-family: Arial; font-size: 12px; font-weight: bold; } i a.aCategory:link{ //enter your style here } a.aCategory:visited { color: #999999; text-decoration: none; font-family: Arial; font-size: 12px; font-weight: bold; } i a.aCategory:visited{ //enter your style here } a.aCategory:active { color: #000000; text-decoration: none; font-family: Arial; font-size: 12px; font-weight: bold; } i a.aCategory:active{ //enter your style here } a.aCategory:hover { color: #999999; text-decoration: none; font-family: Arial; font-size: 12px; font-weight: bold; } i a.aCategory:hover{ //enter your style here } a.aSubCategory:link { color: #000000; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } i a.aSubCategory:link{ //enter your style here } a.aSubCategory:visited { color: #000000; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } i a.aSubCategory:visited{ //enter your style here } a.aSubCategory:active { color: #000000; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } i a.aSubCategory:active{ //enter your style here } a.aSubCategory:hover { color: #000000; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } i a.aSubCategory:hover{ //enter your style here } a:link { color: #000000; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } i a:link{ //enter your style here } a:visited { color: #000000; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } i a:visited{ //enter your style here } a:active { color: #000000; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } i a:active{ //enter your style here } a:hover { color: #000000; text-decoration: none; font-family: Arial; font-size: 11px; font-weight: bold; } i a:hover{ //enter your style here }NOTE : in above code if you want to apply different style for only child a tag if i tag then use i > a instead.
更多推荐
发布评论