对于以下html,动态加载H3标签的值。我希望当h3很长时,在下面的情况下div与类login-box left取值max-with或atleast增加宽度值。但它仍然采用最小值并使设计变得光彩夺目
<div class="login-box left" style="min-width: 230px; max-width:300px">
<div class="login-box-title" style="width:auto">
<h3>Engångslösenordsinloggning</h3>
</div>
答案 0 :(得分:0)
我认为这就是你想要的。我删除了最小宽度并添加了display:inline-block;
<div class="login-box left" style="display: inline-block; max-width:300px">
<div class="login-box-title" style="width:auto">
<h3>Engångslösenordsinloggning</h3>
</div>
答案 1 :(得分:0)
<div class="login-box left" style="min-width: 230px; display:inline-block;">
<div class="login-box-title" style="width:auto">
<h3>Engångslösenordsinloggning</h3>
</div>
</div>