线条高度在谷歌浏览器中不起作用 [英] Line height not working in google chrome

查看:112
本文介绍了线条高度在谷歌浏览器中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友这是我的css代码,以缩短休息时间..







< pre lang =CSS> br {
line-height 2px;
}





此代码适用于mozilla但不适用于谷歌浏览器。请任何人建议我...

解决方案

尝试设置两个边距并将其显示为块项目。我想将样式应用于br是非常罕见的,它不兼容跨浏览器。





  br  {
display block;
margin 10px 0;
}


line-height属性定义了上面的空间量下面的内联元素。也就是说,设置为显示的元素:内联或显示:内联框。此属性最常用于设置文本行的前导。



  p  {
line-height 1.5;
}



line-height属性可以接受关键字值normal或none以及数字,长度或百分比。



根据规范,正常的值不仅仅是应用于所有元素的单个具体值,而是计算为合理值取决于元素上设置(或继承)的字体大小。



可以使用任何有效的CSS单位(px,em,rem等)定义长度值)。



百分比值是元素的字体大小乘以百分比。


Hi friends this is my css code to reduce the break length..



br{
line-height :2px;
}



This code works fine with mozilla but not working with google chrome. please any one can suggest me...

解决方案

Try setting both margin and display it as a block item. I guess apply styles to br is very rare and its not cross browser compatible.


br {
   display: block;
   margin: 10px 0;
}


The line-height property defines the amount of space above and below inline elements. That is, elements that are set to display: inline or display: inline-box. This property is most often used to set the leading for lines of text.

p {
    line-height: 1.5;
}


The line-height property can accept the keyword values normal or none as well as a number, length, or percentage.

According to the spec, a value of "normal" is not just a single concrete value that is applied to all elements, but rather computes to a "reasonable" value depending on the font size set (or inherited) on the element.

A length value can be defined using any valid CSS unit (px, em, rem, etc).

A percentage value is the font size of the element multiplied by the percentage.


这篇关于线条高度在谷歌浏览器中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆