我有以下div日历,我需要相应调整背景图像和文字。我该怎么做?
我的代码:
.calenderArrivalDiv{
margin-top: 15%;
margin-bottom: 1%;
background-image: url("images/SearchReservation/search_button_u754.png");
text-align: center;
background-repeat:no-repeat;
padding-left: 0%;
padding-right: 12%;
text-align: center;
}
.calenderDepDiv{
margin-top: 14%;
margin-bottom: 2%;
background-image: url("images/SearchReservation/search_button_u754.png");
text-align: center;
background-repeat:no-repeat;
}

<div class="col-xs-1 col-sm-1 col-md-1">
<div id="arrivalDate" class="calenderArrivalDiv calanderSize"
ng-click="searchReservationVm.arrivalDtOpen($event)">
<span>
<button tabindex="4" class="dateSearchBar" class="btn btn-primary" id="one"
datepicker-popup="{{'MMM d'}}"
ng-model="searchReservationVm.searchRQ.arrivalDate"
is-open="searchReservationVm.arrivalDtOpened"
ng-change="searchReservationVm.arrivalDateChange()"
datepicker-options="dateOptions"
show-weeks="false"
current-text="Reset To Today's Date"
ng-focus="searchReservationVm.arrivalDtOpen($event)">
<div class="text calFontDate" title="Select Arrival Date">
{{ searchReservationVm.searchRQ.arrivalDate | date : 'MMM' }}</br>
<div class="datediv">
{{ searchReservationVm.searchRQ.arrivalDate | date : 'd' }}
</div>
</div>
</button>
</span>
</div>
</div>
&#13;
答案 0 :(得分:0)
目前还不清楚这里的背景究竟是什么,你在谈论蓝色方块吗?
无论如何看起来你的div大小很小,或者你没有设置宽度/高度。
答案 1 :(得分:0)
请添加background-size:cover
,其中添加的背景图片会在DIV