如何增加UL或OL项目之间的垂直间距 [英] how to increase vertical spacing between UL or OL items

查看:275
本文介绍了如何增加UL或OL项目之间的垂直间距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




使用什么属性和值来进一步隔离一个列表中的项目(假设它是可能的) )?默认的

演示文稿有点揉成一团。对我而言。


谢谢,

Dave

Hi,

what Property and Values are used to space out further from one
another the items in a list (assuming it''s possible)? The default
presentation is a bit "bunched up" for me.

Thanks,
Dave

推荐答案

Dave写道:
Dave wrote:
使用什么属性和值来远离另一个列表中的项目(假设它是可能的)?默认的演示文稿有点揉成一团。对我来说。
what Property and Values are used to space out further from one
another the items in a list (assuming it''s possible)? The default
presentation is a bit "bunched up" for me.




我用的是:


li {

margin-left:0;

保证金权利:10%;

保证金最高:.5em;

保证金底部:.5em;

}


(保证金权利使得LI比他们周围适合我目的的段落

更短)。


您还可以尝试行高:150%(我认为超过120%

大于大多数浏览器默认值)。

- < br $>
jc


从电子邮件中删除-not



I use:

li {
margin-left: 0;
margin-right: 10%;
margin-top: .5em;
margin-bottom: .5em;
}

(The margin-right makes the LIs shorter than the paragraphs
around them which suits my purposes).

You could also try line-height:150% (I think anything over 120%
is larger than most browser defaults).
--
jc

Remove the -not from email


>我使用:

li {
margin-left:0;
margin-right:10%;
margin-top:.5em; <边缘底部:.5em;
}

li {
margin-left: 0;
margin-right: 10%;
margin-top: .5em;
margin-bottom: .5em;
}




或......


li {margin :。5em 10%.5em 0}

边距或填充属性(在顶部,底部或两者上)应该

工作正常。



Or...

li {margin:.5em 10% .5em 0}

the margin or padding properties (on either the top, bottom or both) should
work just fine.


Jeremy Collins< jd ******** @ ntlworld-not.com>写道:
Jeremy Collins <jd********@ntlworld-not.com> wrote:
你也可以尝试行高:150%


嗯,是的,但它有一个完全不同的含义。对于li元素使用margin-top和

margin-bottom是可以的。人们只需要记住,

垂直保证金不会加起来。如果你指定

li {margin-top:0.5em; margin-bottom:0.8em; }

然后列表项之间的距离不是0.5em + 0.8em而是更大的

0.5em和0.8em。


line-height属性设置元素中的行高。虽然

这可能会造成列表项目分离的印象,但它是骗人的b
欺骗性的。当显示区域缩小时,列表项目

内容换行,效果可能相当令人不安。

(我认为超过120%
更大)比大多数浏览器默认值。)
You could also try line-height:150%
Well, yes, but it has a quite different meaning. Using margin-top and
margin-bottom for li elements is fine. One just needs to remember that
vertical margins don''t add up. If you specify
li { margin-top: 0.5em; margin-bottom: 0.8em; }
then the distance between list items is not 0.5em + 0.8em but larger of
0.5em and 0.8em.

The line-height property sets the line height within an element. While
this may create the impression of separation of list items, it''s
deceptive. When the display area is narrowed, so that list item
contents wrap, the effect is probably rather disturbing.
(I think anything over 120%
is larger than most browser defaults).




可能是这样,尽管CSS规范建议

默认值介于1.0和1.2甚至之间在示例样式表中使用以下设置

(显示为非规范性的,但是建议使用
浏览器默认样式,并且还显示为

对浏览器行为的实际研究,尽管其中有很多功能

刚刚组成):

CSS 1:行高:1.1

CSS 2:行高:1.33(高于规范中推荐的范围!)

CSS 2.1 CR:行高:1.12


实际使用的浏览器似乎接近1.2。


结论是由于这种混乱,并且由于

1.2是太很多字体很小(特别是对于无衬线字体,当

行长很大,因为它可能在网上),作者应该

可能设置了body元素'的行高达到合理的价值

如1.25或1.3。由于

继承问题,我会使用普通数字。 (如果为li元素设置例如line-height:150%,那么

元素内的行高将是元素'字体的150%

大小,即使在可能具有不同字体大小的子元素中 - 因为

计算的值是继承的,而不是百分比,但对于普通的

数字,它是数字得到继承,并在

中解释每个元素自身的字体大小。)


-

Yucca, http://www.cs.tut.fi/~jkorpela/


这篇关于如何增加UL或OL项目之间的垂直间距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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