How to do element selection inside another element?
P粉590929392
P粉590929392 2023-08-22 11:08:56
0
2
403

I have a question about CSS selectors. When a

with a specific class name is inside a
    with a class name saft How should I choose it? This CSS class is used elsewhere and I don't want to change the style everywhere.

P粉590929392
P粉590929392

reply all (2)
P粉463811100

Just execute:

ul.saft .textSlide {

This will achieve the functionality you require

    P粉549412038

    Just use the CSS descendant selector (one space) between the parent element and the child element:

    ul.saft div.textSlide { /* CSS规则 */ }

    * { margin: 0; padding: 0 } li { list-style-type: none; } ul.saft div.textSlide { background-color: #f90; font-weight: #000; }
    • 在textSlide类元素中的一些文本
    更多文本,也在textSlide元素中
      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!