我正在寻找一种解决方案让父div自动调整其大小为响应式背景图像,同时仍允许该div内的子元素。我已经使用了另一个线程的解决方案,但正如您所看到的,子元素正在被推下。有什么建议吗?
示例:http://nowicki.nigelyoshida.com/services/
<div id="category-name" style="background-image:url('http://nowicki.nigelyoshida.com/wp-content/uploads/2015/06/nowicki-services.jpg'); background-size: contain; width: 100%; height: auto; padding-top: 65%" class="col-xs-12 page-header-image">
<span>Services</span>
<div class="featured-text">
<h1>Why chiropractic?</h1>
<p>Chiropractic therapy can help maintain a balanced relationship between your musculoskeletal health and nervous system to promote flexibility and pain relief.</p>
</div>
</div>