gpt4 book ai didi

html - CSS - 多行换行

转载 作者:太空宇宙 更新时间:2023-11-04 08:40:16 25 4
gpt4 key购买 nike

如果您能提供帮助,我只想就以下问题提供一些指导。 enter image description here

基本上,如果我在图片描述中有太多文字,它会将图片推高。处理此类问题最有吸引力的方法是什么?

谢谢。

我创建了一个基本的 fiddle - 重新调整窗口大小以使它们内联

JSFiddle

div.gallery {
border: 1px solid #ccc;
}

div.gallery:hover {
border: 1px solid #777;
}

div.gallery img {
width: 30%;
height: auto;
}

div.desc {
padding: 15px;
text-align: center;
}

* {
box-sizing: border-box;
}

.responsive {
padding: 0 6px;
display: inline-block;
width: 15.99999%;
}

@media only screen and (max-width: 700px){
.responsive {
width: 49.99999%;
margin: 6px 0;
}
}

@media only screen and (max-width: 500px){
.responsive {
width: 100%;
}
}

.clearfix:after {
content: "";
display: table;
clear: both;
}

最佳答案

对于 future 的人们,我认为灵活的解决方案真的能帮上忙。

我创建了以下 CSS 代码:

.file-wrapper {
flex-direction: row;
flex-flow: row wrap;
justify-content: center;
display: flex;
}
.file-image {
padding: 30px;
}

.file-box {
text-align: center;
padding: 1em;
flex-basis: 10em;
margin: 1em;
}

.fileTextWrapper {
display: table;
width: 100%;
height: 3em;
}
.file-text {
display: table-cell;
vertical-align: middle;
text-align: center;
width: 100%;
}

HTML 非常容易解释。包装器包含所有元素,然后我有法师及其描述的 div。通过这样做,它们不仅响应迅速,而且居中对齐并且文本被很好地包裹起来。

关于html - CSS - 多行换行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44176283/

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