我有一个漂浮在左边的图像和另一个应该水平向右的图块。它的确如此,除非该块的文本长度变大。然后东西变得混乱。为什么在float:left block之后文本被压低?
这里是我的结构:
post-big-then-small-2-smaller {
height: 100%;
overflow: hidden;
width: 100%;
margin-top: 24px;
padding-bottom: 12px;
border-bottom: 1px solid #e5e5e5;
}
.post-big-then-small-2-smaller .post-thumbnail img {
height: 90px;
width: 40%;
object-fit: cover;
position: relative;
float: left;
margin-right: 10px;
}
.post-big-then-small-2-smaller .entry-header .entry-title {
margin: 0 0 6px 0;
}
.post-big-then-small-2-smaller .entry-header .entry-title a {
white-space: nowrap;
color: #1e1e1e;
font-family: 'Playfair Display', serif;
font-size: 20px;
}
.post-big-then-small-2-smaller .entry-header .entry-meta .entry-date-published {
text-transform: uppercase;
letter-spacing: 3px;
font-size: 10px;
font-family: Montserrat, sans-serif;
font-weight: 600;
color: #3a3a3a;
opacity: 0.5;
}
<article class="post-big-then-small-2-smaller">
<div class="post-thumbnail">
<img class="img-responsive" alt="" src="https://www.marrakech-desert-trips.com/wp-content/uploads/2014/10/Morocco-sahara-desert-tour-Marrakech-to-Merzouga-3-days.jpg"/>
</div>
<header class="entry-header">
<div class="entry-meta">
<h3 class="entry-title"><a href="http://www.google.com" rel="bookmark">Finmus Maximus</a></h3>
<a href="http://www.google.com" rel="bookmark">
<time class="entry-date-published" datetime="2017-07-02T07:31:04+00:00">July 2, 2017</time>
</a>
</header>
</article>
我所经历:
任何想法,为什么?
_“有关为什么?”的任何想法? - 因为你明确指出这应该发生...? '.post-big-then-small-2-smaller .entry-header .entry-title a { white-space:nowrap; ...' – CBroe