【问题标题】:Bootstrap input custom width in form-inline表单内联中的引导输入自定义宽度
【发布时间】:2018-06-15 10:15:37
【问题描述】:

如何在输入组中正确地进行自定义宽度输入? 使各种设备运转良好。

我的代码在 PC 上可以工作,但在移动设备上不行。

.someClass {width:550px;}
 @media (min-width: 768px){
    .form-inline .form-control {
    width: 100%;
     } 
    }
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<link href="https://bootswatch.com/3/darkly/bootstrap.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<form class="form-inline text-center" role="form">
    <div class="input-group">
        <div class="someClass">
            <input type="text" class="form-control"
                   style="width:100%" placeholder="Name" name="name">
        </div>
        <div class="input-group-btn">
            <button class="btn btn-primary" type="submit">Send</button>
        </div>
    </div>
</form>

【问题讨论】:

  • 请发一个sn-p

标签: html css twitter-bootstrap forms input


【解决方案1】:

您的媒体查询以最小宽度为 768 像素的设备为目标。 你可能想调查一下。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-25
    • 2011-10-29
    • 2013-09-24
    • 2014-07-22
    • 2015-03-13
    • 2016-07-17
    相关资源
    最近更新 更多