gpt4 book ai didi

css - 如何在 Firefox 中使用 calc 计算行高?它不工作

转载 作者:行者123 更新时间:2023-11-28 15:48:27 29 4
gpt4 key购买 nike

还有其他方法可以使用 calc 计算行高吗?它在 Firefox 中不起作用。

lineheight: calc(1.8 * (1vw + 1vh - 1vmin));

最佳答案

正确的属性名称是 line-height , 而不是 lineheight:

p.styled {
line-height: calc(1.8 * (1vw + 1vh - 1vmin));
}
<p class="regular">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec velit elit, interdum eu ullamcorper at, ultrices quis turpis. Ut non vehicula dui. Etiam vel auctor diam, nec pretium enim. Maecenas porttitor posuere arcu et eleifend. Vivamus maximus ultrices facilisis. Praesent pretium ex et erat vehicula lobortis. Phasellus varius nisl quis odio suscipit, et feugiat magna mollis.</p>

<p class="styled">Aenean elementum tincidunt sem, in egestas turpis interdum at. Cras ac lectus vitae velit aliquam condimentum eu ac justo. Phasellus at neque rhoncus, vestibulum dui quis, molestie augue. Sed vitae laoreet turpis. Phasellus et ligula sapien. Nunc fermentum nisi feugiat augue imperdiet, vel malesuada elit dictum. Quisque mi magna, laoreet id porttitor non, rutrum ac sem. Nam fringilla commodo mi in porta. Phasellus vehicula felis at risus tristique ornare. Vivamus elementum, nisi pharetra accumsan ullamcorper, massa odio consequat libero, ut rhoncus odio magna eu odio. Maecenas imperdiet, diam vel venenatis cursus, nisi nisl rhoncus orci, a sagittis nisi mi ac quam. Fusce fermentum lacus quis nibh rutrum, sed tempus elit tempus. Vivamus non magna sem.</p>

关于css - 如何在 Firefox 中使用 calc 计算行高?它不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42269113/

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