내 CSS *
(별표)를 사용하여 부모의 모든 하위 항목을 선택하면 모든 하위 요소가 서로 플로팅됩니다. 여기서 이상한 점은 별을 <header>
요소로 변경하고 내 HTML에서 마크 업에 추가하면 모든 하위 요소가 서로 위치 할 것입니다.Css * (별표)는 레이아웃을 파괴합니다. 어떻게 고치는 지?
왜 이런가요?
이<article class="grid_12 post-entry">
<a href="#" title="">
<figure class="post-thumb">
<img src="images/placehold-blog.png" alt="Placehold">
<figcaption class="center">
<p>Entry</p>
<h3>Showreel video.</h3>
<p>By Casper Biemans/On June 3, 2014/In Digital Art</p>
<div class="button tertiaire">Read more →</div>
</figcaption><!-- End figcaption -->
</figure><!-- End figure.post-thumb -->
</a>
</article><!-- End article.grid_12 post-entry -->
CSS는 :
<article class="grid_12 post-entry">
<a href="#" title="">
<figure class="post-thumb">
<img src="images/placehold-blog.png" alt="Placehold">
<figcaption class="center”>
<header>
<p>Entry</p>
<h3>Showreel video.</h3>
<p>By Casper Biemans/On June 3, 2014/In Digital Art</p>
<div class="button tertiaire">Read more →</div>
</header>
</figcaption><!-- End figcaption -->
</figure><!-- End figure.post-thumb -->
</a>
</article><!-- End article.grid_12 post-entry -->
CSS :
레이아웃이 완벽 할 때.blog .post-entry figure { height: 420px; }
.blog .post-entry figcaption {
display: table;
background: rgba(0, 0, 0, .65);
}
.blog .post-entry figcaption > * {
padding: 0;
display: table-cell;
vertical-align: middle;
}
, 나는이 사용
레이아웃이 파괴
, 나는이 사용.blog .post-entry figure { height: 420px; }
.blog .post-entry figcaption {
display: table;
background: rgba(0, 0, 0, .65);
}
.blog .post-entry figcaption header {
padding: 0;
display: table-cell;
vertical-align: middle;
}
? 이 바이올린은 당신의 코드를 사용하고 잘 작동합니다 : http://jsfiddle.net/2swzsdbu/ –
아마도'class = "center"'thing은 그것과 관련이 있습니까? 확실하지 않다, 그냥 묻는다. –
@CBauer 이상하게도 JSfiddle에서 작동하고 내 브라우저에서는 작동하지 않습니다. – Caspert