Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
125 views
in Technique[技术] by (71.8m points)

html - How to select element based on 2 inline styles in CSS?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Specify style*=[""] for each style like this:

div[style*="display: block;"][style*="white-space: nowrap;"]{
  ...
}

div[style*="display: block;"][style*="white-space: nowrap;"]{
  color: red;
}

div[style*="display: block;"]{
  color: green;
}
<div
  style="
    display: block;
    width: 200px;
    border-right: 1px solid rgb(237, 237, 236);
    white-space: nowrap;
    min-height: 32px;
    cursor: default;
    padding: 5px 8px 6px;
    font-size: 14px;
    overflow: hidden;
    height: 32px;
  "
>
  howdie
</div>

<div
  style="
    display: block;
    width: 200px;
    border-right: 1px solid rgb(237, 237, 236);
    min-height: 32px;
    cursor: default;
    padding: 5px 8px 6px;
    font-size: 14px;
    overflow: hidden;
    height: 32px;
  "
>
  howdie
</div>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...