继承相对的CSS样式

时间:2016-08-07 00:51:57

标签: html css

是否可以让以下示例中的第二个图像使用类似于CSS" all:inherit"属性?

HTML

<div class="outer-div">
  <img href="example.url">//first image
  <div>
    <img href="example.url">//second image
  </div>
</div> 

CSS

.outer-div > img {
  height:100px;
}

1 个答案:

答案 0 :(得分:0)

根本不要使用“&gt;”在你的CSS中。

.outer-div img { }

“&gt;” 中=儿童

“”=所有死者

相关问题