gpt4 book ai didi

CSS 设置为内联显示,但检查器显示 block

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

我正在尝试将 h3 标记设置为内联,但无论我在 CSS 中使用什么规则,Inspector 中的框模型都会显示 display: block .

enter image description here

.widget_title {
display:inline;
float:left;
}

知道这是为什么吗?

最佳答案

这看起来很简单:在内联元素上使用 float 属性,它强制 inline 元素成为 block 元素。

Read this CSS specs to learn more.

关键部分在这里:

left The element generates a block box that is floated to the left. Content flows on the right side of the box, starting at the top (subject to the 'clear' property).

关于CSS 设置为内联显示,但检查器显示 block ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32393116/

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