如何调用到div类内部div的CSS? [英] How to call css into div class inner div?

查看:174
本文介绍了如何调用到div类内部div的CSS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从事网络抓取工作。现在我刮了一个网站,并加载到我的网站工作正常。但我需要将CSS添加到一个div。此div不包含任何 id或class



但是我的主div包含类。我怎么能css我内心的div



例如:

  < div class =ct-ui-spinner-animation> 
< div>
< div> <! - 我想在这个div中调用css - >
示例
< / div>
< / div>
< / div>

我正在尝试这种方式

首先尝试:

  .ct-ui-spinner-animation> div 
{
color:#fff!important;
}

第二次尝试

  .ct-ui-spinner-animation {
color:#fff!important;
}

但是没有应用css请引导我。

解决方案

您的代码几乎就在那里。



您需要使用两个子选择器

  .ct-ui-spinner-animation> div> div 
{
color:#fff!important;
}

注意,这将适用于所有 div 元素,它们是 .ct-ui-spinner-animation 类中元素的孙辈。


I am working in web scraping. Now i am scraping one website and load into my website its working fine. But i need to add css into one div. This div does not contain any id or class.

But my main div contain class. How can i css for my inner div

For example:

<div class="ct-ui-spinner-animation">
    <div>
            <div> <!-- I Want to call css in this div-->
                Sample
             </div>
     </div>
</div>

I am trying this ways

First try:

 .ct-ui-spinner-animation > div
   {
    color:#fff !important;
    }

Second try

.ct-ui-spinner-animation {
        color:#fff !important;
    }

But not applying css please guide me. How can i do it.

解决方案

Your code was almost there.

You need to use two child selectors:

.ct-ui-spinner-animation > div > div
{
    color:#fff !important;
}

Notice this will be applied for all the div elements which are the grandchildren of any element with the .ct-ui-spinner-animation class.

这篇关于如何调用到div类内部div的CSS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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