内联级元素:行高,填充和背景 [英] Inline-level elements: line-height, padding and background

查看:59
本文介绍了内联级元素:行高,填充和背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是关于内联级元素''行高,

填充和背景的两种情况,我不明白:


< div style =" background:black;白颜色; line-height:1.5">

< span> Abc< / span>

< span style =" background:white;颜色:黑色; line-height:

3"> Abc< / span>

< span> Abc< / span>

< / div> ;


为什么中间的SPAN元素不具有白色背景区域

为3em,但只有字母后面的白色?


< div style =" background:black;白颜色; line-height:1.5;

font-size:3em">

< span> abc< / span>

< span style =" background:green;颜色:黑色;填充:

0.25em"> Abc< / span>

< span> Abc< / span>

< / div>


为什么在上面的例子中绿色背景区域穿过顶部

和黑色背景区域的底边?


-

Stanimir

Here are two cases regarding inline-level elements'' line-height,
padding and background, which I doesn''t understand:

<div style="background: black; color: white; line-height: 1.5">
<span>Abc</span>
<span style="background: white; color: black; line-height:
3">Abc</span>
<span>Abc</span>
</div>

Why doesn''t the middle SPAN element have white background area tall
as 3em, but has white only behind the letters?

<div style="background: black; color: white; line-height: 1.5;
font-size: 3em">
<span>Abc</span>
<span style="background: green; color: black; padding:
0.25em">Abc</span>
<span>Abc</span>
</div>

Why in the above example the green background area crosses the top
and bottom edges of the black background area?

--
Stanimir

推荐答案

/ Stanimir Stamenkov /:
/Stanimir Stamenkov/:
这里有两个关于内联级元素''行高,填充
和背景的案例,我不明白:
Here are two cases regarding inline-level elements'' line-height, padding
and background, which I doesn''t understand:




Eh - 没有真正的CSSers,真的!? :-)


-

Stanimir



Eh - no real CSSers around, really!? :-)

--
Stanimir


2004年4月6日星期二19:54 :34 + 0300,Stanimir Stamenkov写道:
On Tue, 06 Apr 2004 19:54:34 +0300, Stanimir Stamenkov wrote:
/ Stanimir Stamenkov /:
/Stanimir Stamenkov/:
以下是关于内联级元素''行的两种情况-height,padding
和背景,我不明白:
Here are two cases regarding inline-level elements'' line-height, padding
and background, which I doesn''t understand:



呃 - 没有真正的CSSers,真的!? : - )



Eh - no real CSSers around, really!? :-)




显然不是在1小时15分钟

,因为你发布了这个问题,没有。


-

Andrew Thompson
http:// www.PhySci.org/ 开源软件套件
http: //www.PhySci.org/codes/ Web& IT帮助
http://www.1point1C.org/ Science&技术



Apparently not in the 1hr 15mins
since you posted the question, no.

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology


2004年4月6日星期二18:47:06 GMT,Andrew Thompson写道:
On Tue, 06 Apr 2004 18:47:06 GMT, Andrew Thompson wrote:
4月6日星期二2004 19:54:34 +0300,Stanimir Stamenkov写道:
On Tue, 06 Apr 2004 19:54:34 +0300, Stanimir Stamenkov wrote:
/ Stanimir Stamenkov /:
/Stanimir Stamenkov/:
以下是关于内联级别的两个案例元素''行高,填充
和背景,我不明白:
Here are two cases regarding inline-level elements'' line-height, padding
and background, which I doesn''t understand:



呃 - 没有真正的CSSers,真的!? : - )



Eh - no real CSSers around, really!? :-)



显然不是1小时15分钟
因为你发布了问题,没有。



Apparently not in the 1hr 15mins
since you posted the question, no.




哎呀!尝试* 3天* 1小时15分钟。

是的,好的。略有不同。


-

Andrew Thompson
http://www.PhySci.org/ 开源软件套件
http://www.PhySci.org/codes/ Web& IT帮助
http://www.1point1C.org/ Science&技术



Ooops!! Try *3 days* 1hr 15mins.
Yeah, OK. Slight difference.

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology


这篇关于内联级元素:行高,填充和背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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