474,008 Members | 1,959 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

padding problem..

hi,

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(image s/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..


Nov 27 '07 #1
11 2399
In article <fi**********@a ioe.org>, maya <ma********@yah oo.com>
wrote:
hi,

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(image s/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..
A doctype? A modern browser? And finally, a URL so we can see.

--
dorayme
Nov 27 '07 #2
dorayme wrote:
In article <fi**********@a ioe.org>, maya <ma********@yah oo.com>
wrote:
>hi,

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(image s/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..

A doctype? A modern browser? And finally, a URL so we can see.
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.dt d">
<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..
Nov 27 '07 #3
dorayme wrote:
In article <fi**********@a ioe.org>, maya <ma********@yah oo.com>
wrote:
>hi,

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(image s/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..

A doctype? A modern browser? And finally, a URL so we can see.
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...

Nov 27 '07 #4
In article <fi**********@a ioe.org>, maya <ma********@yah oo.com>
wrote:
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...
Perhaps something like

http://netweaver.com.au/alt/maya.html

I guess.

--
dorayme
Nov 27 '07 #5
dorayme wrote:
In article <fi**********@a ioe.org>, maya <ma********@yah oo.com>
wrote:
>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...

Perhaps something like

http://netweaver.com.au/alt/maya.html

I guess.
yes, but did u measure that <td>?? I did a screenshot and measured in
Photoshop, it's 420px wide....;)

thank you though, I appreciate your help....

Nov 27 '07 #6
maya wrote on 27 nov 2007 in comp.infosystem s.www.authoring.stylesheets:
dorayme wrote:
>In article <fi**********@a ioe.org>, maya <ma********@yah oo.com>
wrote:
>>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...

Perhaps something like

http://netweaver.com.au/alt/maya.html

I guess.

yes, but did u measure that <td>?? I did a screenshot and measured in
Photoshop, it's 420px wide....;)
try:

<http://www.mioplanet.c om/products/pixelruler/>

Cheaper and faster than PS.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 27 '07 #7
In article <fi**********@a ioe.org>, maya <ma********@yah oo.com>
wrote:
dorayme wrote:
In article <fi**********@a ioe.org>, maya <ma********@yah oo.com>
wrote:
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...
Perhaps something like

http://netweaver.com.au/alt/maya.html

I guess.

yes, but did u measure that <td>?? I did a screenshot and measured in
Photoshop, it's 420px wide....;)

thank you though, I appreciate your help....
Oh you are still worried about that business. Sorry. I have said
things about that in another post, so has Jonathan Little. Did
you get those?

Do you understand what I was saying about it being more than just
according to standards but common sense that padding will
increase height or width naturally and that height and width
specifications cannot be thought to be max height and width. On
this latter, here is another argument: suppose you tell an
element which from its natural content would be say 200px tall,
to be only 20px tall. What do you think should happen, what does
happen? In other words, height instructions are not king. There
are other things that go on to temper and add and probably
subtract.

(btw You don't need Photoshop, download the Firefox browser and
then down load the web developer tools. You will find an
excellent ruler in it that is a easy to use right there on the
webpage).

--
dorayme
Nov 27 '07 #8
On 2007-11-27, dorayme <do************ @optusnet.com.a uwrote:
[...]
Do you understand what I was saying about it being more than just
according to standards but common sense that padding will
increase height or width naturally and that height and width
specifications cannot be thought to be max height and width. On
this latter, here is another argument: suppose you tell an
element which from its natural content would be say 200px tall,
to be only 20px tall. What do you think should happen, what does
happen?
Unless it's a table cell, row or table, it should be exactly 20px tall
and the content overflows. Usually you can still see it, but only
because the overflow property is set to visible.
In other words, height instructions are not king. There
are other things that go on to temper and add and probably
subtract.
Apart from tables, you should always get exactly the height you ask
for (measured between the top and bottom inside-padding edges).
Nov 28 '07 #9
In article <sl************ *********@bowse r.marioworld>,
Ben C <sp******@spam. eggswrote:
On 2007-11-27, dorayme <do************ @optusnet.com.a uwrote:
[...]
Do you understand what I was saying about it being more than just
according to standards but common sense that padding will
increase height or width naturally and that height and width
specifications cannot be thought to be max height and width. On
this latter, here is another argument: suppose you tell an
element which from its natural content would be say 200px tall,
to be only 20px tall. What do you think should happen, what does
happen?

Unless it's a table cell, row or table, it should be exactly 20px tall
and the content overflows. Usually you can still see it, but only
because the overflow property is set to visible.
In other words, height instructions are not king. There
are other things that go on to temper and add and probably
subtract.

Apart from tables, you should always get exactly the height you ask
for (measured between the top and bottom inside-padding edges).
I was thinking too much about table cells, you are right. It was
misleading.

Heights are tricky customers in practice and there are some
delicious counter-intuitive things that are nice to look at and
get clear on:

http://tinyurl.com/272lfm

(this is not intended as any dispute with you or anyone, just a
reminder to myself to make up an easy to remember story to think
of these things as a hobby maybe over the Xmas break... <gJust
btw, MacIE and no doubt WinIE 6 are a bit more intuitively what
you would expect on above url. I have not looked at Win, but
MacIE is a tiny clue to me.)

--
dorayme
Nov 28 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5652
by: delerious | last post by:
Could someone please take a look at this page: http://home.comcast.net/~delerious1/index11.html The set of links on the left should not have any whitespace between them, and the set of links on the right should have one pixel of whitespace between them. That's how it looks in IE and Opera. But in Mozilla, a few of the links on the left have whitespace between them, and some of the links on the right don't have whitespace between them...
2
19198
by: Knoxy | last post by:
Hello, I've noticed one or two people post on this before but nobody seems to have replied so raising the issue again... is this a known IE6 CSS bug? I have placed the following in my stylesheet file: ..formContentTable
7
8849
by: Gustaf Liljegren | last post by:
I continued on the example shown earlier today: http://gusgus.cn/test/index.html Now I get some unwanted space in Firefox (the red space just below the first image) which doesn't appear in IE6. I've double-checked the CSS for any padding or margings than may cause it, but have found none. How can I remove it? Thanks,
4
4301
by: Wilhelm Kutting | last post by:
hi, when i use the padding-left attribut, i like to overwrite a default value like that ..padding30 {margin-left: 30px;} ..padding0 {margin-left: 0px;} <div class="padding30"> Padding 30 <div id="padding0">
2
4420
by: Remi Villatel | last post by:
Hi there, I have following CSS definitions: div.limits { margin: 0 20px 0 20px; } div.halfleft { float: left; left: 0; width: 50%;
36
3095
by: phil-news-nospam | last post by:
Here is a simpler (no drop shadows) example of the padding bug I see: http://phil.ipal.org/usenet/ciwas/2006-05-08/buttons-1.html So far I find nothing in the CSS2 document that says I should get this kind of inconsistent result. -- ----------------------------------------------------------------------------- | Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
10
12930
by: Alan Silver | last post by:
Hello, In my (seemingly) endless quest to understand CSS, I have yet another problem. Please look at http://www.kidsinaction.org.uk/ph/x.html in Opera, where you will see it how I expected. If you look at it in IE (6 or 7), you find it also looks fine, except for the top margin missing from the links across the top of the page. That's not the main issue here, but any pointers as to why it doesn't show them would be appreciated.
5
10549
by: Tom | last post by:
I am having a problem where an extra gap (whitespace, padding) appears in a table cell where I don't want it. The data fed in the table is via dynamic HTML, so the amount in the middle cell may vary. When the data in the middle table cell is little and that cell's height is small, an unwanted gap appears in the first table cell. I would prefer to have all additional blank space at the bottom of the table (last row) and not have any in...
5
2213
by: Mike | last post by:
I am having a problem with padding. I have three boxes and I want them all to be the same width. In IE it looks like the outside of the DIV stays put and the padding is placed on the inside, so the bottom box lines up with the middle box - which is what I want. In FF it looks like the padding is making the DIV grow to the size of the padding and the boxes then don't line up. If I take the padding out, then the boxes are the same width, but...
3
3899
by: xoinki | last post by:
hi all, I have a DIV element for which a table is appended.. CSS for this div element is.. .optiondiv { display:block; padding: 0px 30px; padding-left: 30px; padding-right: 30px;
0
10446
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11990
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11527
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
11033
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
10205
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8595
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6716
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3891
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.