且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

包装文本中的行高

更新时间:2023-12-04 12:57:16

Frostillicus写道:
Frostillicus wrote:
我创建有困难网页左侧的菜单,其中每个链接看起来边缘都有一个4px的填充,但我正在尝试将其作为一个纯无序的列表。 当前网页只是一个没有
超链接的订单项,样式表会处理所有事情。

我认为这样做之后一切都很好和花花公子:
#menu li {line-身高:22px;如本例所示:
http://marc.fearby .com / line-height.html 但是一旦
文字换到第二行,难看的效果就是两条线之间的差距很大。

但这只是没有用。我试过#menu li a {
padding-bottom:4px;这对于包含超链接但不包含普通列表项的列表项是很好的。当我尝试为普通列表项目执行此操作时,它们看起来很好,但却以超链接为代价。在此处使用
内联样式的示例: http://marc.fearby.com/ padding.html

我不能修复一个而不破坏另一个而且我不能使用我曾经绕过的负边距
遗嘱左边的问题相同(或者至少我还没有工作呢,不幸的是)。

这样的事情可能只有简单的列表和
超链接或者我将不得不使用div为东部列表
项目和一些方法使其与额外的标签一起工作?我肯定不希望...
I''m having difficulty creating a menu on the left of a web
page where each link appears to have a 4px padding around
the edge but I''m trying to do this as a pure unordered
list. The "current web page" is just a line item without
a hyperlink and the stylesheet takes care of everything.

I thought I had everything fine and dandy after doing this:
#menu li { line-height: 22px; } as seen in this example:
http://marc.fearby.com/line-height.html but as soon as the
text wraps to a second line, the unsightly effect is a
large gap between the two lines.

I then thought about using padding settings here and there
but this just didn''t work. I tried #menu li a {
padding-bottom: 4px; } which is fine for list items that
contain hyperlinks, but not for ordinary list items. As
soon as I try doing this for ordinary list items, they look
fine at the expense of those with hyperlinks. Example with
inline style here: http://marc.fearby.com/padding.html

I can''t fix one up without ruining the other and I can''t
employ negative margins which I used to get around this
same problem for the margin-left (or at least I haven''t got
it to work yet, unfortunately).

Is such a thing possible with just bare-bones lists and
hyperlinks or am I going to have to use divs for east list
item and fine some way to make it work with extra tags? I
sure hope not...




只有一个额外的标签和一个额外的样式块与标签一起使用

: - )

http://locusmeus.com/temp/frostillicus .html


这就是你要找的东西吗?我有点迷失在你故事中的填充和像素......


-

Els
http://locusmeus.com/

Sonhos vem。 Sonhos v?o。 Orestoébritfeito。

- Renato Russo -



Only one extra tag and one extra styleblock to go with the tag
:-)

http://locusmeus.com/temp/frostillicus.html

Is that what you were looking for? I sort of got lost in all
the paddings and pixels in your story...

--
Els
http://locusmeus.com/
Sonhos vem. Sonhos v?o. O resto é imperfeito.
- Renato Russo -


Els写道:
Els wrote:
Frostillicus写道:
Frostillicus wrote:
我在网页左侧创建一个菜单时遇到困难,其中每个链接看起来都有一个4px填充边缘但是我我试图以纯粹的无序列表来做这件事。 当前网页只是一个没有
超链接的订单项,样式表负责处理所有事情。
[...]这样的事情可能只有简单的列表和
超链接,或者我将不得不使用div为东部列表
项目和罚款某种方式来使它使用额外的标签?我确定希望不...
I''m having difficulty creating a menu on the left of a web
page where each link appears to have a 4px padding around
the edge but I''m trying to do this as a pure unordered
list. The "current web page" is just a line item without
a hyperlink and the stylesheet takes care of everything. [...] Is such a thing possible with just bare-bones lists and
hyperlinks or am I going to have to use divs for east list
item and fine some way to make it work with extra tags? I
sure hope not...



只有一个额外的标签和一个额外的样式块与
标签一起使用
: - )>
http://locusmeus.com/temp/frostillicus.html

这就是你在找什么?我有点迷失在你故事中的所有填充和像素......



Only one extra tag and one extra styleblock to go with the
tag
:-)

http://locusmeus.com/temp/frostillicus.html

Is that what you were looking for? I sort of got lost in
all the paddings and pixels in your story...




哦,顺便说一句,摆脱pt的字体大小,使用百分比,所以IE

用户也可以调整它们的大小。


-

Els
http://locusmeus.com/

Sonhos vem。 Sonhos v?o。 Orestoébritfeito。

- Renato Russo -



Oh, and btw, get rid of pt for font-size, use percentages, so IE
users can resize them too.

--
Els
http://locusmeus.com/
Sonhos vem. Sonhos v?o. O resto é imperfeito.
- Renato Russo -


2004年8月19日星期四22:46:45 +1000,Frostillicus

< fr **** @ nilspamos.iinet.net.au>写道:
On Thu, 19 Aug 2004 22:46:45 +1000, "Frostillicus"
<fr****@nilspamos.iinet.net.au> wrote:
我在网页左侧创建一个菜单时遇到困难,其中每个
链接看起来边缘都有一个4px填充但是我''我试图这样做
作为一个纯粹的无序列表。 当前网页只是一个没有
超链接的订单项,样式表会处理所有事情。

我认为这样做之后一切都很好,花花公子:#menu li {
line-身高:22px;如本例所示:
http://marc.fearby .com / line-height.html 但是一旦文本换行到第二行,难看的效果就是两行之间的差距很大。
然后我考虑在这里和那里使用填充设置,但这只是
不起作用。我试过#menu li a {padding-bottom:4px;这适用于包含超链接的列表项,但不适用于普通列表项。我很快就尝试对普通列表项进行此操作,但他们看起来很费用那些带有超链接的人。此处带内联样式的示例:
http://marc.fearby.com/ padding.html
I''m having difficulty creating a menu on the left of a web page where each
link appears to have a 4px padding around the edge but I''m trying to do this
as a pure unordered list. The "current web page" is just a line item without
a hyperlink and the stylesheet takes care of everything.

I thought I had everything fine and dandy after doing this: #menu li {
line-height: 22px; } as seen in this example:
http://marc.fearby.com/line-height.html but as soon as the text wraps to a
second line, the unsightly effect is a large gap between the two lines. I then thought about using padding settings here and there but this just
didn''t work. I tried #menu li a { padding-bottom: 4px; } which is fine for
list items that contain hyperlinks, but not for ordinary list items. As soon
as I try doing this for ordinary list items, they look fine at the expense
of those with hyperlinks. Example with inline style here:
http://marc.fearby.com/padding.html




#menu li {padding-bottom:4px;我会工作得很好,除非你通过在#menu

li a中指定背景颜色来看似混淆了一些东西。而不是#menu li。如果你想在与当前页面相对应的单元格中使用不同的背景颜色

,那么你需要一个关于

类的单元格,但我建议使用对比鲜明的前景色如果不是更好的话,那将是




实际上它可能会更好看(a)填充一路

,和(b)在ems中填充,因此它与文本大小成比例。

像#menu li {padding:0.3em; }


-

Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/