为什么不填充 - 正确工作??? [英] Why isnt padding-right working???

查看:62
本文介绍了为什么不填充 - 正确工作???的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在文本的右侧放置一个简单的填充

容器,以防止文本溢出开箱即用。我添加了

一个填充权限规则,它拒绝在IE或

Firefox中识别它。我用左边填充完全一样,那就是

工作得很好。什么是裂缝???

http:// www.ainewmedia.co.uk/css_page.htm


#bodyContent {

font-family:Verdana,Arial,Helvetica,sans- serif;

background-image:url(images / body_side_bg.png);

background-repeat:repeat-y;

padding-top :10px;

填充左:15px;

填充权:10px;

宽度:750px;

font-size:12px;

line-height:20px;

}

解决方案

我觉得你被背景图片搞糊涂了。评论出来和

在#bodyContent周围添加一个边框,看看会发生什么:


#bodyContent {

....

ZZZbackground-image:url(images / body_side_bg.png);

....

border:1px solid red;}


我觉得你很困惑背景图片。评论

out并在#bodyContent周围添加一个边框,看看会发生什么:


#bodyContent {

...

ZZZbackground-image:url(images / body_side_bg.png);



/ * background-image:url(images / body_side_bg.png); * /


...

border:1px solid red;}



添加那些ZZZ可能会导致整个事情失败。


-

-bts

-Motorcycles无视重力;汽车只是吮吸。


jo *** ********@yahoo.co.uk 写道:


我想在我的右侧放一个简单的填充text

容器,用于阻止文本溢出开箱即用。我添加了

一个填充权限规则,它拒绝在IE或

Firefox中识别它。我用左边填充完全一样,那就是

工作得很好。什么是裂缝???

http:// www.ainewmedia.co.uk/css_page.htm


#bodyContent {

font-family:Verdana,Arial,Helvetica,sans- serif;

background-image:url(images / body_side_bg.png);

background-repeat:repeat-y;

padding-top :10px;

填充左:15px;

填充权:10px;

宽度:750px;

font-size:12px;

line-height:20px;

}



你的填充在那里。添加


边框:薄实红色;


以上,你会看到边框内的DIV的范围,

*包括*填充。


bodyContent DIV的宽度为750px,文本填充

宽度,显然也是关于

背景图像中矩形的宽度。右侧填充位于右侧。填充

不是宽度的一部分,它是宽度的补充。将宽度

更改为730px,看看会发生什么。


I want to put a simple padding on the right hand side of my text
container to stop the text from overflowing out of the box. Ive added
a padding-right rule and it refusing to recognise it in either IE or
Firefox. Ive done exactly the same with the left padding and thats
worked fine. Whats the crack???

http://www.ainewmedia.co.uk/css_page.htm

#bodyContent {
font-family:Verdana, Arial, Helvetica, sans-serif;
background-image: url(images/body_side_bg.png);
background-repeat: repeat-y;
padding-top: 10px;
padding-left: 15px;
padding-right: 10px;
width: 750px;
font-size: 12px;
line-height: 20px;
}

解决方案

I think you''re being confused by the background image. Comment that out and
add a border around #bodyContent and see what happens:

#bodyContent{
....
ZZZbackground-image: url(images/body_side_bg.png);
....
border: 1px solid red;}



Bill Norton wrote:

I think you''re being confused by the background image. Comment that
out and add a border around #bodyContent and see what happens:

#bodyContent{
...
ZZZbackground-image: url(images/body_side_bg.png);

/* background-image: url(images/body_side_bg.png); */

...
border: 1px solid red;}

Adding those ZZZ may cause the whole thing to fail.

--
-bts
-Motorcycles defy gravity; cars just suck.


jo***********@yahoo.co.uk wrote:

I want to put a simple padding on the right hand side of my text
container to stop the text from overflowing out of the box. Ive added
a padding-right rule and it refusing to recognise it in either IE or
Firefox. Ive done exactly the same with the left padding and thats
worked fine. Whats the crack???

http://www.ainewmedia.co.uk/css_page.htm

#bodyContent {
font-family:Verdana, Arial, Helvetica, sans-serif;
background-image: url(images/body_side_bg.png);
background-repeat: repeat-y;
padding-top: 10px;
padding-left: 15px;
padding-right: 10px;
width: 750px;
font-size: 12px;
line-height: 20px;
}

Your padding is there. Add

border: thin solid red;

above and you''ll see the extent of the DIV that lies inside the border,
*including* the padding.

The width of the bodyContent DIV is 750px, and the text fills that
width, which is evidently also about the width of the rectangle in the
background image. The right padding is to the right of that. Padding
isn''t part of the width, it''s in addition to the width. Change the width
to 730px and see what happens.


这篇关于为什么不填充 - 正确工作???的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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