CSS:如何将样式应用于特定的类 [英] CSS: How to apply style to a specific class

查看:76
本文介绍了CSS:如何将样式应用于特定的类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请问一个css问题.

我有以下html代码:

<ion-item *ngFor="let item of dummyJobModels" class="item-search-dummy">
</ion-item>

这将生成以下代码:

我想隐藏border-bottom.我需要为list-md类设置,但仅为item-search-dummy类下的元素设置.我已经尝试了以下方法,但是不起作用:

I would like to hide the border-bottom. I need to set for the list-md class, but for only the elements under the item-search-dummy class. I have tried the following, but it does not work:

.item-search-dummy.list-md {
  border-bottom: 0px;
}

如果有人可以建议我如何有选择地设置class属性,我将不胜感激.

If anyone can advise how I can selectively set a class attribute, I would appreciate it.

推荐答案

您可以尝试

.list-md .item-search-dummy .item-inner{
    border-bottom: none !important;
 }

这篇关于CSS:如何将样式应用于特定的类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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