Dies ist mein HTML-CodeCss grid - Inhalt inline, versteckt Überlauf
<div class="longtext">
<div class="image">
<img src="https://c1.staticflickr.com/8/7610/17149522281_3b6ae4c948_b.jpg" alt="">
</div>
<div class="text">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="buy">
<a href="#">$ 3053</a>
</div>
</div>
Ich mag würde erreichen, alle Inhalte inline angezeigt werden, so etwas wie diese.
Bild haben Dimensionen definiert, .text und .buy Breite ist unbekannt. .buy muss immer ganz und in einer Zeile angezeigt werden. .text muss auch in einer Zeile angezeigt werden, aber es ist nicht notwendig, ganzen Text anzuzeigen.
Hier ist mein CSS noch
.longtext {
border: 1px solid red;
overflow: hidden;
}
.longtext > * {
float: left;
}
.longtext img {
height: 60px;
width: 60px;
}
.buy {
float: right;
border: 1px solid blue;
}
.text {
border: 1px solid black;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
Haben Sie eine Nonflex Lösung wissen? – user7376146
@ user7376146 Sie können etwas Ähnliches tun, indem Sie '.longtext' auf' display: table' und die 3 Kinder auf 'display: table-cell' setzen, aber flexbox ist großartig und ermöglicht Dinge wie' flex-grow' und die horizontale/vertikale Ausrichtungsoptionen. Es hat auch> 97% Browser-Unterstützung. http://caniuse.com/#feat=flexbox –