【发布时间】:2018-03-27 02:41:37
【问题描述】:
我希望我的图像相对于左侧文本垂直对齐到中心,这样当屏幕尺寸发生变化时,图像仍然相对于文本保持在中心。 我尝试使用 vertical-align:middle 但没有任何效果。
#content .col {
float: left;
width: 50%;
padding: 10px;
background: white;
font-size: 19px;
}
#content .col {
height: 1000px;
}
#content .col img {
float: right;
vertical-align: bottom;
}
.skills {
font-weight: bold;
list-style: none;
}
.skills li:before {
margin: 10px;
/* content: '✓';*/
color: forestgreen;
content: "\2714\0020";
}
<div id="content">
<div class="col imgcol">
<img class="responsive-img circle" src="img/bg.jpg" style="vertical-align:bottom">
</div>
<div class="col textcol">
<p><b>hello this is some text.this is some text.this is some text.this is some text.</b></p>
<p>this is some text.this is some text.this is some text.this is some text.this is some text.this is some text.this is some text.this is some text.this is some text.this is some text.this is some text.this is some text.this is some text.this is some
text.this is some text.this is some text.this is some text.this is some text.this is some text.this is some text.this is some text.this is some text.this is some text.this is some text.this is some text.this is some text.this is some text.this is
some text.this is some text.this is some text.this is some text.this is some text.</p>
<ul class="skills">
<li>this is some text.</li>
<li>this is some text.</li>
<li>this is some text.</li>
<li>this is some text.</li>
<li>this is some text.</li>
<li>this is some text.</li>
<li>this is some text.</li>
<li>this is some text.</li>
</ul>
</div>
【问题讨论】: