css:
.search{
.time{
&:first-child{
margin-left: 0px !important;
}
&:nth-last-child(2){
margin-left: -12px !important;
}
}
}
html:
<div?class="search">
????????<div?class="time">
??????????<span>关键字:</span>
??????????<el-input?v-model="selected.Text"?prefix-icon="el-icon-search"?class="search_input"?/>
????????</div>
????????<div?class="time">
??????????<span>记录时间:</span>
??????????<el-date-picker?v-model="selected.Time1"?type="date"?placeholder="选择开始日期"?class="search_input"?/>
????????</div>
????????<el-button?size="small">查询</el-button>
??????</div>
last-child默认的最后一个元素为button,所以设置最后一个time的样式时,要使用倒数第二个才能设置到样式