HTML
CSS
JavaScript
HTML
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>搜索布局3 - 光年(Light Year Admin)后台管理系统模板</title>
<link rel="icon" href="favicon.ico" type="image/ico">
<meta name="keywords" content="LightYear,光年,后台模板,后台管理系统,光年HTML模板">
<meta name="description" content="LightYear是一个基于Bootstrap v3.3.7的后台管理系统的HTML模板。">
<meta name="author" content="yinqi">
<link href="http://lyear.itshubao.com/iframe/css/bootstrap.min.css" rel="stylesheet">
<link href="http://example.itshubao.com/demo/css/materialdesignicons.min.css" rel="stylesheet">
<!--日期选择插件-->
<link rel="stylesheet" href="http://lyear.itshubao.com/iframe/js/bootstrap-datepicker/bootstrap-datepicker3.min.css">
<link href="http://lyear.itshubao.com/iframe/css/style.min.css" rel="stylesheet">
</head>
  
<body>
<div class="container-fluid">
  
  <div class="row">
    
    <div class="col-lg-12">
      <div class="card">
        <div class="card-header">搜索条件一</div>
        <div class="card-body">
          <p>特别多搜索条件时,也可将所有搜索条件放到 <code>card-body</code> 中。</p>
          <form action="#!" method="post" class="form-horizontal form-search">
            
            <div class="row">
              <div class="col-md-4">
                <div class="form-group">
                  <label class="w-120 pull-left control-label"><span class="text-danger">*</span> 任务名称</label>
                  <div class="pull-left w-120-calc">
                    <input type="text" class="form-control pull-left" name="name" value="" placeholder="请输入任务名称" />
                  </div>
                </div>
              </div>
              <div class="col-md-4">
                <div class="form-group">
                  <label class="w-120 pull-left control-label"><span class="text-danger">*</span> 任务类型</label>
                  <div class="pull-left w-120-calc">
                    <select name="type" class="form-control" id="type">
                      <option value="1">小说</option>
                      <option value="2">古籍</option>
                      <option value="3">专辑</option>
                      <option value="4">自传</option>
                    </select>
                  </div>
                </div>
              </div>
              <div class="col-md-4">
                <div class="form-group">
                  <label class="w-120 pull-left control-label">任务描述</label>
                  <div class="pull-left w-120-calc">
                    <input type="text" class="form-control pull-left" name="name" value="" placeholder="任务描述" />
                  </div>
                </div>
              </div>
              <div class="col-md-4">
                <div class="form-group">
                  <label class="w-120 pull-left control-label"><span class="text-danger">*</span> 责任人</label>
                  <div class="pull-left w-120-calc">
                    <input type="text" class="form-control pull-left" name="name" value="" placeholder="责任人" />
                  </div>
                </div>
              </div>
              <div class="col-md-4">
                <div class="form-group">
                  <label class="w-120 pull-left control-label"><span class="text-danger">*</span> 提醒时间</label>
                  <div class="pull-left w-120-calc">
                    <input class="form-control js-datepicker" type="text" name="example-datepicker" placeholder="yyyy-mm-dd" value="" data-date-format="yyyy-mm-dd" />
                  </div>
                </div>
              </div>
              <div class="col-md-4">
                <div class="form-group">
                  <label class="w-120 pull-left control-label">执行人</label>
                  <div class="pull-left w-120-calc">
                    <select name="type" class="form-control">
                      <option value="1">马小云</option>
                      <option value="2">马小腾</option>
                      <option value="3">张小阳</option>
                      <option value="4">唐小磊</option>
                    </select>
                  </div>
                </div>
              </div>
            </div>
            
          </form>
        </div>
      </div>
    </div>
    
    <div class="col-lg-12">
      <div class="card">
        <div class="card-header">搜索条件二</div>
        <div class="card-body">
          
          <div class="row clearfix my-search-box">
            <form action="#!" method="post" class="form-inline col-sm-7 col-md-5">
              <div class="form-group">
                <lable>起始时间:</lable>
                <select name="type" class="form-control">
                  <option value="2020">2020</option>
                  <option value="2019">2019</option>
                  <option value="2018">2018</option>
                  <option value="2017">2017</option>
                </select>
                <span>年</span>
                <select name="type" class="form-control">
                  <option value="1">1</option>
                  <option value="2">2</option>
                  <option value="3">3</option>
                  <option value="4">4</option>
                  <option value="5">5</option>
                  <option value="6">6</option>
                  <option value="7">7</option>
                  <option value="8">8</option>
                  <option value="9">9</option>
                  <option value="10">10</option>
                  <option value="11">11</option>
                  <option value="12">12</option>
                </select>
                <span>月</span>
                <select name="type" class="form-control">
                  <option value="1">1</option>
                  <option value="2">2</option>
                  <option value="3">3</option>
                  <option value="4">4</option>
                  <option value="5">5</option>
                  <option value="6">6</option>
                  <option value="7">7</option>
                  <option value="8">8</option>
                  <option value="9">9</option>
                  <option value="10">10</option>
                </select>
                <span>日</span>
              </div>
            </form>
            <div class="col-sm-5 col-md-7">
              <div class="form-group has-feedback m-b-0">
                <label class="sr-only">关键词</label>
                <input class="form-control" type="text" name="keywords" value="" />
                <span class="mdi mdi-magnify form-control-feedback" aria-hidden="true"></span>
              </div>
            </div>
          </div>
          
        </div>
      </div>
    </div>
	
  </div>
  
</div>
  
<script type="text/javascript" src="http://lyear.itshubao.com/iframe/js/jquery.min.js"></script>
<!--日期选择插件-->
<script type="text/javascript" src="http://lyear.itshubao.com/iframe/js/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>
<script type="text/javascript" src="http://lyear.itshubao.com/iframe/js/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script>
<script type="text/javascript" src="http://lyear.itshubao.com/iframe/js/main.min.js"></script>
</body>
</html>
CSS
/*示例*/
.w-120 {
    width: 120px;
    padding: 0px 15px;
}
.w-120-calc {
    width: -moz-calc(100% - 120px);
    width: -webkit-calc(100% - 120px);
    width: calc(100% - 120px);
    padding-right: 15px;
}
.col-md-offset-120 {
    margin-left: 120px;
}
@media (max-width: 768px) {
    .form-search.form-horizontal .control-label {
        padding-top: 7px;
        margin-bottom: 0;
        text-align: right;
    }
}
@media (max-width: 360px) {
    .form-search.form-horizontal .control-label,
    .form-search.form-horizontal .w-120-calc{
        float: none!important;
        width: auto!important;
        padding-left: 15px;
    }
    .form-search.form-horizontal .control-label {
        margin-bottom: 5px;
    }
}
  
/*搜索条件二*/
@media only screen and (max-width: 768px) and (min-width: 420px) { 
.my-search-box .form-inline .form-control {
    display: inline-block;
    width: auto;
    vertical-align: middle;
}
}
.form-control-feedback {
    height: 38px;
    width: 38px;
    line-height: 38px;
}
JavaScript