【发布时间】:2014-08-25 20:40:02
【问题描述】:
我需要使 bootstrap v3.1.0 表单可折叠并且与 bootstrap 导航栏 100% 相似。当引导导航栏折叠时它会折叠。请帮我。这是我的html代码:
<div class="form-container">
<div class="contact-form">
<div class="form-text">
<h3>Free Advice And Consultation</h3>
</div>
<form class="form-inline" role="form">
<div class="form-group middle-form">
<label for="exampleInputEmail2">Name</label>
<input type="name" class="form-control" id="exampleInputName" placeholder="Enter name">
</div>
<div class="form-group middle-form">
<label for="exampleInputPhone">Phone</label>
<input type="phone" class="form-control" id="exampleInputPhone" placeholder="Phone">
</div>
<div class="form-group middle-form">
<label for="exampleInputEmail2">Email address</label>
<input type="email" class="form-control" id="exampleInputEmail2" placeholder="Enter email">
</div>
<div class="form-group middle-form">
<label for="exampleInputEmail2">Treatment</label>
<select class="form-control">
<option>Relaxation Massage</option>
<option>Remedial Massage</option>
<option>Sports Massage</option>
<option>Trigger Point Massage</option>
<option>Float Bath</option>
<option>Infrared Sauna</option>
</select>
</div>
<button type="submit" class="btn btn-default middle-form">Send</button>
</form>
</div>
</div>
CSS:
.form-container{
max-width: 1230px;
margin-left: auto;
margin-right: auto;
padding-left: 15px;
padding-right: 15px;
}
.contact-form{
width:100%;
height:auto;
max-width:1680px;
background-color: #ac9762;
}
.form-text{
float:left;
width:230px;
}
.border-top{
padding-top: 30px;
padding-left: 30px;
height: 3px solid #fefdfc;
width:10px;
background-color:#fefdfc;
}
.form-text h3{
padding-top: 30px;
padding-left: 30px;
font-size:20px;
font-weight:bold;
color:#fefdfc;
}
label{
display: block;
padding-top: 30px;
}
.form-control{
margin-bottom: 30px;
border-radius: 0px;
margin-right: 30px;
}
.contact-form .btn{
border-radius: 0px;
margin-top: 24px;
}
.contact-form .btn-default{
background-color: #090805;
border-color: #090805;
padding-top: 5px;
color: #fefdfc;
}
.contact-form h3:before {
width: 4.5%;
background: none repeat scroll 0 0 #fefdfc;
border-top: 1px solid #fefdfc;
content: "";
height: 5px;
position: absolute;
margin-top: -10px;
}
【问题讨论】:
-
你能提供一个jsfiddle吗?
-
这里是 jsfeddile [link] (jsfiddle.net/rubel01/quprLza0) 你可以在这里看到全屏结果 [link] (jsfiddle.net/rubel01/quprLza0/embedded/result)
标签: javascript jquery html css twitter-bootstrap