Bootstrap表单输入标签需要内联

时间:2015-09-04 11:17:24

标签: html css twitter-bootstrap

我使用bootstrap css创建了一个表单,我需要标签与输入字段一起显示内嵌,通常这会自动发生,而这次没有人可以帮忙吗?

<style>

    #form-inpt{
        width: 200px;
    }

</style>

<form>

    <!-- Name and email -->
    <label>Name</label><input id="form-inpt" class="form-control" type="text" name="name">
    <label>Email Address</label><input id="form-inpt" class="form-control" type="text" name="email">

    <!-- Business information -->
    <label>Company Name</label><input id="form-inpt" class="form-control" type="text" name="CompanyName">
    <label>Company Phone Number</label><input id="form-inpt" class="form-control" type="text" name="CompanyPhone">
    <label>Address Line 1</label><input id="form-inpt" class="form-control" type="text" name="Address1">
    <label>Address Line 2</label><input id="form-inpt" class="form-control" type="text" name="Address2">
    <label>Address Line 3</label><input id="form-inpt" class="form-control" type="text" name="Address3">
    <label>Town</label><input id="form-inpt" class="form-control" type="text" name="Town">
    <label>County</label><input id="form-inpt" class="form-control" type="text" name="County">
    <label>Post Code</label><input id="form-inpt" class="form-control" type="text" name="PostCode">
    <label>Opening Hours</label><textarea id="form-inpt" class="form-control" name="OpeningHours"></textarea>
    <label>Website</label><input id="form-inpt" class="form-control" type="text" name="Website">

    <!-- Google map coordinates -->
    <label>Longitude</label><input id="form-inpt" class="form-control" type="text" name="Longitude">
    <label>Latitude</label><input id="form-inpt" class="form-control" type="text" name="Latitude">

    <!-- Anti spam -->
    <label>Anti Spam, What is 9+1?</label><input id="form-inpt" class="form-control" type="text" name="Spam">

    <!-- Button -->
    <label>Submit</label><input class="form-control" type="submit" value="submit" style="width: 200px;>

</form>

1 个答案:

答案 0 :(得分:1)

尝试使用像

这样的bootstrap div类
<div class="row">
    <div class="row">
        <label Id="1">...</label><input ...../>
    </div>
    <div class="row">
        <label Id= "2">...</label><input ...../>
    </div>
    .
    .
    .
</div>