我正在尝试使用内联样式自定义输入字段,但它不起作用
这是我的尝试
<div class="row vh-md-100">
<div class="col-md-7 my-md-auto text-center text-md-left">
<h1 class="display-3 text-white font-weight-bold">Div</h1>
<p class="lead text-light my-4">Div</p>
<input style="width:1;" width="1" placeholder="What is your best email">
<a href="#signup" class="btn btn-primary page-scroll">send</a>
</div>
</div>
我原以为输入宽度会改变,但这并没有发生。我错过了什么?
发布于 2019-06-07 10:10:07
因为您没有为它指定单位。
你写了width: 1,但是1是什么?它可以是cm、px、em和许多其他东西。You need to specify it。
如果您阅读链接中的文档,您将看到所有单位的列表,并且您可以在没有单位的情况下使用的唯一数字是0。
<div class="row vh-md-100">
<div class="col-md-7 my-md-auto text-center text-md-left">
<h1 class="display-3 text-white font-weight-bold">Div</h1>
<p class="lead text-light my-4">Div</p>
<input style="width:1px;" width="1" placeholder="What is your best email">
<a href="#signup" class="btn btn-primary page-scroll">send</a>
</div>
</div>
发布于 2019-06-07 10:11:32
它应该有一个单元。试试1px。见下文
<div class="row vh-md-100">
<div class="col-md-7 my-md-auto text-center text-md-left">
<h1 class="display-3 text-white font-weight-bold">Div</h1>
<p class="lead text-light my-4">Div</p>
<input style="width:1px;" placeholder="What is your best email">
<a href="#signup" class="btn btn-primary page-scroll">send</a>
</div>
</div>
https://stackoverflow.com/questions/56487127
复制相似问题