gpt4 book ai didi

html - 在较小的屏幕上展开元素的高度

转载 作者:行者123 更新时间:2023-11-28 07:18:04 25 4
gpt4 key购买 nike

https://jsfiddle.net/7v0dyfo3/

这就是(不完全是,没有样式)我要为列表做的事情。一切都很好,但无法正确调整大小。我希望 div episode-box 为智能手机屏幕扩展其高度,以便文本可以在图像下方垂直显示。

它的编码不是很正确,但是你能告诉我错误调整大小的错误是什么吗?

<article class="full-width">

<div class="post-box">

<div class="container">
<div class="row">
<div class="col-md-12">
<div class="guide-art-container">



<div class="episode-content">

<div class="saga">

<div class="row">
<div class="col-md-12">
<div class="episode-box">
<div class="episode-img">
<img class="thumbnail-ep" src="http://image.noelshack.com/fichiers/2015/35/1440684992-img.jpg"/>
</div>
<span class="episode-nb"> <p>001</p></span>
<div class="episode-single- content">
<div class="episode-single-title">
<h5><b><a href="http://google.fr">Lorem Ipsum Title</a></b></h5>
</div>
<div class="episode-single- desc">
<p><b>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</b>
<br> Sed interdum luctus erat, in Sed interdum luctus erat, in</p>
<hr2>
<span class="cast"><p> <b>Scénario:</b> Sed interdum · <b>Art:</b> Sed interdum · <br>
<b>Animation:</b> Sed interdum · <b>Réalisation:</b> Sed interdum</p></span>
</div>


</div>
</div>
<div class="episode-box">
<div class="episode-img">
<img class="thumbnail-ep" src="http://image.noelshack.com/fichiers/2015/35/1440684992-img.jpg"/>
</div>
<span class="episode-nb"><p>001</p></span>
<div class="episode-single-content">
<div class="episode-single-title">
<h5><b><a href="http://google.fr">Lorem Ipsum Title</a></b></h5>
</div>
<div class="episode-single-desc">
<p><b>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</b>
<br> Sed interdum luctus erat, in Sed interdum luctus erat, in</p>
<hr2>
<span class="cast"><p> <b>Scénario:</b> Sed interdum · <b>Art:</b> Sed interdum · <br>
<b>Animation:</b> Sed interdum · <b>Réalisation:</b> Sed interdum</p></span>
</div>


</div>
</div>
</div>

</div>

</div>
</div>
</div>
</div>
</div>

</div>





</div><!--.post-box-->

</article>

最佳答案

你需要使用媒体查询

像这样:(将浏览器最小化以查看效果)

.full-width {
margin: 0 0 30px;
padding: 0;
}
.container {
max-width: 1170px;
width: 100%;
}
.row {
margin-right: -15px;
margin-left: -15px;
}
@media (min-width: 1200px)
.col-md-12 {
width: 100%;
}
.guide-art-container {
padding: 25px;
}
.saga-title {
margin-top: 15px;
}
.episode-box {
width: auto;
background-color: #F9F9F9;
margin-top: 7px;
box-shadow: inset 0px 100px 150px -150px rgba(204,204,204,1);
height: 150px;
border: 1px solid #E8E8E8;
position: relative;
}
.episode-img {
float: left;
}
.episode-box img {
float: left;
margin-right: 10px;
padding: 5px;
}
span.episode-nb {
position: absolute;
bottom: 2px;
left: 5px;
background-color: #FC8A19;
max-width: 100px;
width: 100%;
opacity: 0.8;
text-align: center;
color: #fff;
font-weight: bold;
font-size: 15pt;
}
.episode-single-content {
padding: 10px 10px 10px 0px;
max-height: 150px;
}
.episode-single-desc {
max-height: 150px;
font-size: 9pt;
padding-right: 4px;
padding-left: 5px;
padding-top: 5px;
}
span.cast {
font-size: 7.4pt !important;
font-family: 'Roboto', Arial, Tahoma, Sans-serif;
line-height: 19px;
}
.thumbnail-ep {
float: left;
margin-right: 10px;
position: relative;
max-width: 260px;
width: 100%;
padding: 2px;
}
span.episode-nb {
position: absolute;
bottom: 2px;
left: 5px;
background-color: #FC8A19;
max-width: 100px;
width: 100%;
opacity: 0.8;
text-align: center;
color: #fff;
font-weight: bold;
font-size: 15pt;
}
.episode-single-title h5 {
margin-top: 2px !important;
}

@media only screen and (max-width : 480px) {
.episode-img {
float:none;
position:relative;
}

.episode-box img {
float:none;
}

.thumbnail-ep {
float:none;
}

.episode-box {
height:auto;
}
}
<article class="full-width">

<div class="post-box">

<div class="container">
<div class="row">
<div class="col-md-12">
<div class="guide-art-container">



<div class="episode-content">

<div class="saga">

<div class="row">
<div class="col-md-12">
<div class="episode-box">
<div class="episode-img">
<img class="thumbnail-ep" src="http://image.noelshack.com/fichiers/2015/35/1440684992-img.jpg"/>
<span class="episode-nb"><p>001</p></span>
</div>

<div class="episode-single-content">
<div class="episode-single-title">
<h5><b><a href="http://google.fr">Lorem Ipsum Title</a></b></h5>
</div>
<div class="episode-single-desc">
<p><b>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</b>
<br> Sed interdum luctus erat, in Sed interdum luctus erat, in</p>
<hr2>
<span class="cast"><p><b>Scénario:</b> Sed interdum · <b>Art:</b> Sed interdum · <br>
<b>Animation:</b> Sed interdum · <b>Réalisation:</b> Sed interdum</p></span>
</div>


</div>
</div>
<div class="episode-box">
<div class="episode-img">
<img class="thumbnail-ep" src="http://image.noelshack.com/fichiers/2015/35/1440684992-img.jpg"/>
<span class="episode-nb"><p>001</p></span>
</div>

<div class="episode-single-content">
<div class="episode-single-title">
<h5><b><a href="http://google.fr">Lorem Ipsum Title</a></b></h5>
</div>
<div class="episode-single-desc">
<p><b>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</b>
<br> Sed interdum luctus erat, in Sed interdum luctus erat, in</p>
<hr2>
<span class="cast"><p><b>Scénario:</b> Sed interdum · <b>Art:</b> Sed interdum · <br>
<b>Animation:</b> Sed interdum · <b>Réalisation:</b> Sed interdum</p></span>
</div>


</div>
</div>
</div>

</div>

</div>
</div>
</div>
</div>
</div>

</div>





</div><!--.post-box-->

</article>

JS Fiddle

关于html - 在较小的屏幕上展开元素的高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32252190/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com