我正在尝试将输入框置于页面中央。当您单击“价格”按钮时,它应该在居中的按钮下方显示一个文本框。相反,它一直向左显示。
这是我的:
<div class="header-content">
<div class="header-content-inner">
<h1 class="text text-primary vintage-retro sr-intro">IFixIT Repair</h1>
<hr class ="sr-intro">
<p style="font-family:Arial;" class ="text sr-intro">Repairs By Students, For Students</p>
<a href='#repair' class="btn btn-primary btn-xl page-scroll sr-intro btn-margin-head">Schedule Repair</a>
</div>
<a href="#repair-prices" class="btn btn-primary btn-xl sr-intro btn-margin-head" data-toggle="collapse">Prices</a>
<div id="repair-prices" class="text-center collapse">
<input class="typeahead form-control" name="search" placeholder="Model of Device (i.e. iPhone 6)">
</div>
</div>
有了这个,我在点击按钮后得到了这个结果: The box is all the way to the left.
任何帮助都会很棒!如果您需要查看其他内容,请告诉我。谢谢!
最佳答案
尝试使用 <center>
标记,这可能会有所帮助。
如果您使用的是 HTML5,这将不起作用,您必须使用 CSS 居中。
关于javascript - Bootstrap - 居中输入文本框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40756074/