1
有沒有其他方式使用calc for lineheight?它不在Firefox中工作。如何在firefox中使用lineheight的calc?它不起作用
lineheight: calc(1.8 * (1vw + 1vh - 1vmin));
有沒有其他方式使用calc for lineheight?它不在Firefox中工作。如何在firefox中使用lineheight的calc?它不起作用
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>
這解釋了爲什麼它在我輸入後對我有用。 – Rob
你有沒有嘗試添加前綴'-moz-calc'? – Treeindev
它適合我。 @Treeindev您不需要calc的供應商前綴。 – Rob
@Treeindev它沒有工作 – radiance88