我有一个页面的html将根据酒店的设施填写。显然,有些酒店比其他酒店有更多,但这是一个模板,所以我必须满足所有含义,我必须有更多包含div而不是有时需要。
<div class="col-md-6 color-blue py-4 d-flex align-items-center flex-wrap facilities">
<div class="w-50 d-flex"><i class="material-icons align-middle">ac_unit</i> Air Conditioning</div>
<div class="w-50 d-flex"><i class="material-icons align-middle">accessible</i> Disabled Access</div>
<div class="w-50 d-flex"><i class="material-icons align-middle">restaurant</i> Restaurant</div>
<div class="w-50 d-flex"><i class="material-icons align-middle">pool</i> Pool</div>
<div class="w-50 d-flex"><i class="material-icons align-middle">child_care</i> Kids Activities</div>
<div class="w-50 d-flex"><i class="material-icons align-middle">access_time</i> 24 Hour Reception</div>
<div class="w-50 d-flex"><i class="material-icons align-middle">fitness_center</i> Gym</div>
<div class="w-50 d-flex"><i class="material-icons align-middle">wifi</i> Internet</div>
<div class="w-50 d-flex"><i class="material-icons align-middle">person_outline</i> Concierge</div>
<div class="w-50 d-flex"><i class="material-icons align-middle">spa</i> Sauna</div>
<div class="w-50 d-flex"><i class="material-icons align-middle">room_service</i> Room Service</div>
<div class="w-50 d-flex"><i class="material-icons align-middle"></i> </div>
<div class="w-50 d-flex"><i class="material-icons align-middle"></i> </div>
<div class="w-50 d-flex"><i class="material-icons align-middle"></i> </div>
</div>
所以伪代码是:如果i元素为:empty,则父div将显示:none。
我在用Less做这件事时遇到了麻烦,似乎无法让它正常工作。任何帮助,将不胜感激。