填充问题.. [英] padding problem..

查看:73
本文介绍了填充问题..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我最近注意到填充属性正在添加到元素的尺寸

,这给我带来了很多困难。 。


如果我有这个:


< div class =" divMore" align =" right">< a href ="">阅读更多< / a>< / div>


和css:


..divMore {background-image:url(images / bg_more.jpg);

background-repeat:no-repeat;高度:40像素; padding-top:10px;}


它将10px加到这个元素的高度,使它不是40px高,但

50px高..这不是padding属性应该如何工作..

我的理解是填充在元素边缘之间填充填充和

元素的内容,它不应该添加到DIMENSION元素..

这给我带来了困难.. :(拜托,我错过了什么......


非常感谢你..




I''ve been noticing lately that padding property is ADDING to dimensions
of element, this is causing me lots of difficulties..

if for example I have this:

<div class="divMore" align="right"><a href="">Read More</a></div>

and in css:

..divMore {background-image:url(images/bg_more.jpg);
background-repeat:no-repeat; height:40px; padding-top:10px;}

it ADDS 10px to HEIGHT of this element, making it not 40px high, but
50px high.. this is not how padding property is supposed to work..
my understanding is padding puts padding between edge of element and
content of element, it''s not supposed to ADD to DIMENSION of element..
this is causing me difficulties.. :( please, what am I missing...

thank you very much..


推荐答案

在文章< fi ********** @ aioe.org> ;, maya< ; ma ******** @ yahoo.com>

写道:
In article <fi**********@aioe.org>, maya <ma********@yahoo.com>
wrote:

hi,

我最近注意到padding属性正在增加尺寸

元素,这给我带来了很多困难..


,例如我有这个:


< div class =" divMore" align =" right">< a href =""> Rea d更多< / a>< / div>


和css:


.divMore {background-image:url(images / bg_more.jpg);

background-repeat:no-repeat;高度:40像素; padding-top:10px;}


它将10px加到这个元素的高度,使它不是40px高,但

50px高..这不是padding属性应该如何工作..

我的理解是填充在元素边缘之间填充填充和

元素的内容,它不应该添加到DIMENSION元素..

这给我带来了困难.. :(拜托,我错过了什么......


非常感谢..


I''ve been noticing lately that padding property is ADDING to dimensions
of element, this is causing me lots of difficulties..

if for example I have this:

<div class="divMore" align="right"><a href="">Read More</a></div>

and in css:

.divMore {background-image:url(images/bg_more.jpg);
background-repeat:no-repeat; height:40px; padding-top:10px;}

it ADDS 10px to HEIGHT of this element, making it not 40px high, but
50px high.. this is not how padding property is supposed to work..
my understanding is padding puts padding between edge of element and
content of element, it''s not supposed to ADD to DIMENSION of element..
this is causing me difficulties.. :( please, what am I missing...

thank you very much..



一个doctype?一个现代浏览器?最后,我们可以看到一个URL。


-

dorayme

A doctype? A modern browser? And finally, a URL so we can see.

--
dorayme


dorayme写道:
dorayme wrote:

文章< fi ******* ***@aioe.org>,maya< ma ******** @ yahoo.com>

写道:
In article <fi**********@aioe.org>, maya <ma********@yahoo.com>
wrote:

> hi,

我最近注意到填充属性正在添加到元素的尺寸,这给我带来了很多困难..

如果我有这个:

< div class =" divMore" align =" right">< a href ="">阅读更多< / a>< / div>

和css:

.divMore {background-image:url(images / bg_more.jpg);
background-repeat:no-repeat;高度:40像素; padding-top:10px;}
它将10px加到这个元素的高度,使它不是40px高,但是高50px ..这不是填充属性应该如何工作。 。
我的理解是填充填充元素边缘和元素内容之间的填充,它不应该添加到元素的DIMENSION ..
这给我带来了困难..: (拜托,我错过了什么...

非常感谢..
>

I''ve been noticing lately that padding property is ADDING to dimensions
of element, this is causing me lots of difficulties..

if for example I have this:

<div class="divMore" align="right"><a href="">Read More</a></div>

and in css:

.divMore {background-image:url(images/bg_more.jpg);
background-repeat:no-repeat; height:40px; padding-top:10px;}

it ADDS 10px to HEIGHT of this element, making it not 40px high, but
50px high.. this is not how padding property is supposed to work..
my understanding is padding puts padding between edge of element and
content of element, it''s not supposed to ADD to DIMENSION of element..
this is causing me difficulties.. :( please, what am I missing...

thank you very much..



doctype?现代浏览器?最后,一个URL,所以我们可以看到。


A doctype? A modern browser? And finally, a URL so we can see.



对不起,不能分享网址,这是在工作,开发服务器,不是活的

但是......现在没有时间重新创建(也许今晚@ home ..)doctype

正在使用的是


<!DOCTYPE html PUBLIC" - // W3C // DTD XHTML 1.0 Transitional // EN"

" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >

< html xmlns =" http://www.w3.org/1999/xhtml" xml:lang =&q UOT;恩" lang =" en">


选择doctype不是我的,不能改变......


那么什么那么,填充和边距之间的区别是什么?我的意思是

那么你应该怎么添加填充空间所以元素的内容

不是对元素的边缘??? :(


谢谢..

sorry, can''t share url, this is at work, development server, not live
yet.. don''t have time now to re-create (maybe tonight @ home..) doctype
being used is

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

choice of doctype is not mine, that can''t change...

so what''s the difference, then, between padding and margin??? I mean
how then are you supposed to add padding space so content of an element
is not against the edge of element??? :(

thank you..


dorayme写道:
dorayme wrote:

文章< fi ********** @ aioe.org>,maya< ma ******** @ yahoo.com>

写道:
In article <fi**********@aioe.org>, maya <ma********@yahoo.com>
wrote:

> hi,

我最近注意到padding属性正在添加到元素的尺寸
给我带来很多困难..

如果我有这个:

< div class =" divMore" align =" right">< a href ="">阅读更多< / a>< / div>

和css:

.divMore {background-image:url(images /bg_more.jpg);
background-repeat:no-repeat; height:40px; padding-top:10px;}
它将10px加到此元素的高度,使其不是40px高,但是50px高..这不是填充属性应该如何工作..
我的理解是填充在元素的边缘和元素的内容之间填充t,它不应该添加到元素的DIMENSION ..
这导致我的困难.. :(拜托,我错过了什么...

非常感谢你..
>

I''ve been noticing lately that padding property is ADDING to dimensions
of element, this is causing me lots of difficulties..

if for example I have this:

<div class="divMore" align="right"><a href="">Read More</a></div>

and in css:

.divMore {background-image:url(images/bg_more.jpg);
background-repeat:no-repeat; height:40px; padding-top:10px;}

it ADDS 10px to HEIGHT of this element, making it not 40px high, but
50px high.. this is not how padding property is supposed to work..
my understanding is padding puts padding between edge of element and
content of element, it''s not supposed to ADD to DIMENSION of element..
this is causing me difficulties.. :( please, what am I missing...

thank you very much..



doctype?现代浏览器?最后,我们可以看到一个URL。


A doctype? A modern browser? And finally, a URL so we can see.



所以如果我有一个< tdthat',比如400px宽,我在

它,我想要一个仅在右边填充(所以表格cellpadding

属性在这里不好),比如20px,所以有20px的空白空间

在paragr的右边缘和< td>的边缘之间,你是怎么做到的???????


谢谢...

so if I have a <tdthat''s, say, 400px wide, and I put a paragraph in
it, and I want a padding ONLY ON THE RIGHT (so table cellpadding
property is not good here) of, say, 20px, so there''s 20px empty space
between right edge of paragr and edge of <td>, how do you do that??????

thank you...


这篇关于填充问题..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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