我有一个容器中有2个div,图像留下50%,文本正确50%。文本部分有一个阅读更多链接,将扩展它包含div,使图像和文本更高,如此 -
闭
打开
div.feature {
display: flex;
flex-flow: row wrap;
justify-content: center;
width: 100%;
}
div.feature>div.feature-image {
background-size: cover;
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
div.feature>div.feature-image,
div.feature>div.feature-description {
float: left;
width: 50%;
}

<div class="feature">
<div class="feature-image" style="background-image: url('http://cablelabs.dev/wp-content/uploads/2017/07/Smart-Drugs-banner.jpg');"></div>
<div class="feature-description">
<div class="featured-description-container">
<h3>Smart Drugs/Meds</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<br>
<div class="slidingDiv" style="display: block;">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="read-more-button-container">
<a href="#" class="show_hide tech-read-more-button" style="display: inline-block;">Read Less</a>
</div>
</div>
</div>
</div>
&#13;
我正在使用flex来实现此功能。这适用于全屏,但当它缩小到较小的屏幕尺寸时,图像的高度为0
。任何人都可以帮助解释为什么图像不会在较小的屏幕上显示?