gpt4 book ai didi

css - 如何水平显示内容字段?

转载 作者:行者123 更新时间:2023-11-28 17:00:36 25 4
gpt4 key购买 nike

我试图水平显示字段的内容,但没有成功。它始终是显示的垂直 View 。我错过了什么吗?

这是 php 代码。

感谢您的帮助。

<h3>Details</h3>
<ul>
<?php foreach ($custom_fields['quote'] as $custom_quote_field_name => $custom_quote_field_value) : ?>
<li><?php echo $custom_quote_field_name; ?> : <?php echo $custom_quote_field_value; ?></li>
<?php endforeach; ?>
</ul>

最佳答案

您的问题在于您的 CSS 和 HTML 输出,而不一定是生成它的 PHP。

如果您有权访问 CSS 样式表,则可以使用多种方法:

行内 block

ul {
font-size: 0;
/*makes inline-block method work, as " " in your DOM have a font-size,
and we want to eliminate those
*/
}
ul li {
font-size: 18px; //or however large you would like
display: inline-block;
width: calc(100% / X); //where X is number of li
}

float

ul {

}
ul li {
font-size: 18px; //or however large you would like
float: left;
margin-left: X; //where X is the gap you want between elements
}

flexbox

ul {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
ul li {

}

关于css - 如何水平显示内容字段?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53309398/

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