gpt4 book ai didi

html - 根元素不会将其显示更改为内联

转载 作者:行者123 更新时间:2023-12-04 14:54:00 25 4
gpt4 key购买 nike

当我尝试将根 html 元素的显示属性更改为内联或初始时,它仍然是 block 类型。为什么会这样? enter image description here

最佳答案

永远不要弄乱 Root 元素(html 元素)。它不应该被设计或改变。<​​/p>

来自 the specification :

  1. Otherwise, if the element is the root element, 'display' is set according to the table below,

并且在表中你可以看到inline(指定值)被转换为block(计算值)


display 并不是唯一在涉及到根元素时具有特定行为的属性,所以不要尝试设置它的样式,否则你会很头疼。

关于html - 根元素不会将其显示更改为内联,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68506752/

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