我有一张图片,一个标题和一个描述。
我想在左侧显示图片,然后在其旁边显示标题和描述。
使用浮动很容易实现,但是使用inline-block是否也可以呢?我无法找到不使用浮动就能正确显示的方法。
那么正确的方法是什么呢?使用浮动是否“不好”呢?
JSFiddle: https://jsfiddle.net/g1euvcbx
这是我现在的内容:
我想要的最终结果是:
使用浮动很容易实现,但是使用inline-block是否也可以呢?我无法找到不使用浮动就能正确显示的方法。
那么正确的方法是什么呢?使用浮动是否“不好”呢?
JSFiddle: https://jsfiddle.net/g1euvcbx
.path-team {
text-align: left;
.item-list {
width: 80%;
margin: 0 auto;
}
.list-item {
margin: 0;
padding: 0;
}
.field__item {
font-weight: bold;
padding-bottom: 5px;
p {
font-weight: normal;
padding-bottom: 25px;
}
img {
margin: 0 auto;
margin-bottom: 10px;
padding: 0;
}
}
/* positioning */
ul {
list-style: none;
margin: 0;
padding: 0;
li {}
ul {
margin: 0;
padding: 0;
}
}
}
<div class="path-team">
<ul class="item-list">
<li class="list-item">
<div class="field-collection-item">
<div class="content">
<div class="field field--name-field-picture">
<div class="field__item">
<img src="https://i.gyazo.com/e201976d7a4fd5745d9cc1af713943b4.png" alt="Sofie">
</div>
</div>
<div class="field field--name-team-name">
<div class="field__item">
Sofie
</div>
</div>
<div class="field field--name-team-short-desc">
<div class="field__item">
<p>
Bunch of text goes in here.
Could be multiple lines of text.
It's a description of the person.
To the left we want the persons picture.
At the top to the right of the picture we want the persons name in bold.
Below that we want this text.
</p>
</div>
</div>
</div>
</div>
</li>
</ul>
</div>