【发布时间】:2017-06-07 02:40:04
【问题描述】:
我有一个包含 3 个 div 的 div。
HTML 代码
.state {
background-color: rgba(233, 234, 237, 0.9);
height: 7vh;
width: 80%;
border-radius: 14px;
margin: 10px 0 15px 80px;
display: flex;
align-items: stretch;
}
.state-main {
text-align: center;
padding-top: 10px;
font-weight: 900;
font-size: 14px;
}
.options {
text-align: right;
margin-bottom: 10px;
}
.owner-image {
border-top-left-radius: 14px;
border-bottom-left-radius: 14px;
}
<div class="state">
<div class="owner">
<img class="owner-image" src="img/uk.jpg">
</div>
<div class="state-main">
<p class="state-name">PENNSYLVANIA</p>
</div>
<div class="options">
<p id="time"></p>
<button>SEND TROOPS</button>
<button>ATTACK</button>
</div>
</div>
【问题讨论】:
-
请张贴您的html。您可以使用
</>图标在此处嵌入实时示例 -
查看这篇文章:stackoverflow.com/questions/2156712/…这是你想要实现的吗?
-
尝试添加margin-right:auto;和左边距:自动;到你的 3 个 div 。
-
@PriyeshKumar 我添加了 html 代码。