在这个问题上,我不能理解选择器的用法。
.fc > * {
margin: 10px;
padding: 20px;
background-color: lightgray;
border-radius: 10px;
}那么.fc > *是什么意思呢?因为我真的不能“完全”理解这个。
HTML部件
<body>
<div class="fc">
<header>Swanns Way - Overture</header>
<aside>For a long time I used to go to bed early. Sometimes, when I had put out my candle, my eyes would close so quickly that I had not even time to say "I'm going to sleep."</aside>
<main>And half an hour later the thought that it was time to go to sleep would awaken me; I would try to put away the book which, I imagined, was still in my hands, and to blow out the light; I had been thinking all the time, while I was asleep, of what I had just been reading, but my thoughts had run into a channel of their own, until I myself seemed actually to have become the subject of my book: a church, a quartet, the rivalry between François I and Charles V. </main>
<section>This impression would persist for some moments after I was awake; it did not disturb my mind, but it lay like scales upon my eyes and prevented them from registering the fact that the candle was no longer burning. </section>
<footer>by Marcel Proust</footer>
</div>
发布于 2017-08-07 05:07:37
在现代CSS中,没有后代选择器这样的东西。该术语在CSS2中使用,但被后代组合符取代。
后代组合符由两个选择器之间的空格字符表示。
您的示例中没有这样的示例。你有一个大于号的符号,那是一个子组合符。
给定:
<a>
<b>
<c>
</c>
</b>
</a>的孙子项(而不是子项
.fc是一个类选择器。*是通用选择器(它匹配所有内容)
所以选择器是作为fc类成员的元素的子元素的每个元素。
https://stackoverflow.com/questions/45532946
复制相似问题