一些 CSS 属性在 Chrome 控制台上有效,但在 Firefox 上无效

问题描述 投票:0回答:1

这是我的代码,

console.log('%c Hello, World!', 'background:linear-gradient(45deg,#FF0099,#493240);padding:5px;font-weight:900;border-radius:5px;')

border-radius
padding-block
border-radius
无法像图片那样在 Firefox 上工作

但它在铬上运行良好

我必须启用某些功能吗?还是firefox有限制?

css firefox console
1个回答
0
投票

Firefox 将消息视为内联元素。您应该设置

display: inline-block
以获得所需的行为。 (参考:https://developer.mozilla.org/en-US/docs/Web/API/console#sect4

© www.soinside.com 2019 - 2024. All rights reserved.