我有这个代码
...
<div>
<label>Identification:</label>
<input type="text" name="identification" value="" maxlength="20">
<strong class="characters">20</strong>
<p class="description">
<span class="icon_description"></span>Item description
</p>
</div>
...
现在它看起来像这样的图像
我需要将它提高到父元素的100%。因此,label
可以固定到特定的宽度,其余元素固定到宽度空间的其余部分。请告诉我跨浏览器的css3怎么做?
发布于 2018-06-26 22:56:58
嗨,我改正了一些代码。下面的代码可以在所有浏览器中运行。
<!Doctype>
<html>
<body>
<div style="width:500px;margin-top:40px;">
<label style="width:86px;float:left;">Identification:</label>
<div style="width:404px;float:right;margin-left:10px;">
<input type="text" name="identification" value="" maxlength="20" style="width:45%;">
<strong class="characters" style="width:10%;">40</strong>
<h4 style="width:45%;float:right;margin-top:0px;">Item description</h4>
</div>
</div>
</body>
</html>
https://stackoverflow.com/questions/50654330
复制相似问题