473,785 Members | 2,482 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IE cannot put padding on IMGs?

I'm trying to add some simple padding to an IMG by using a padding-right
style, but it doesn't work in IE. Works fine in Mozilla and Opera, though.

Here's a link to a page which displays this IE problem:

http://home.comcast.net/~delerious1/index12.html

I do know that I can solve the problem in IE by changing padding-right to
margin-right, but then the links cannot be clicked when the mouse is over that
margin area. So I would really like to get the padding working in IE. Any
ideas?

Jul 20 '05 #1
17 29241
wrote on 21 dec 2003 in comp.infosystem s.www.authoring.stylesheets:
I'm trying to add some simple padding to an IMG by using a
padding-right style, but it doesn't work in IE. Works fine in Mozilla
and Opera, though.


Padding is IMHO putting a spacing between a container and its contents.
But an img is NOT a container, so IE is right not to construct that.
It is like padding a string of letters instead of its container.

+++ You cannot padd(?) something around itself,
padding is an inside job. +++

If you want padding AROUND an image, that is called a margin.
<span style="padding: 3px;"><img src=".."></span>

is about the same as

<img style="margin:3 px;" src="..">

so never use the same class for img and containers, if you want to use
things ike padding in it.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #2
Evertjan. wrote:
Padding is IMHO putting a spacing between a container and its contents.
But an img is NOT a container, so IE is right not to construct that.
It is like padding a string of letters instead of its container.
Padding is spacing between the border and the contents. Margin is
spacing between the total width (width+padding+ border) of the element
and the container.
+++ You cannot padd(?) something around itself,
padding is an inside job. +++
That is incorrect. Especially for images the W3C box model makes sense.
If you want padding AROUND an image, that is called a margin.
Again, incorrect.
so never use the same class for img and containers, if you want to use
things ike padding in it.


:?
--
Anne van Kesteren
<http://www.annevankest eren.nl/>
Jul 20 '05 #3
<de*******@no.s pam.com> wrote in message
news:3f******** ******@news.md. comcast.giganew s.com...
I'm trying to add some simple padding to an IMG by using a padding-right
style, but it doesn't work in IE. Works fine in Mozilla and Opera, though.
Here's a link to a page which displays this IE problem:

http://home.comcast.net/~delerious1/index12.html

I do know that I can solve the problem in IE by changing padding-right to
margin-right, but then the links cannot be clicked when the mouse is over that margin area. So I would really like to get the padding working in IE. Any ideas?


The problem lies in trying to make the A element display as BLOCK while
including an image as part of the link. See my previous examples from your
other questions. There are better answers i'm sure but I get identicle
output in both IE6 and Mozilla, Opera is another story...


Jul 20 '05 #4
On Sun, 21 Dec 2003 13:39:25 GMT, "SwissChees e" <Sw*********@cf l.rr.com>
wrote:
The problem lies in trying to make the A element display as BLOCK while
including an image as part of the link. See my previous examples from your
other questions. There are better answers i'm sure but I get identicle
output in both IE6 and Mozilla, Opera is another story...


Thanks for the replies, SwissCheese.

Jul 20 '05 #5
Anne van Kesteren wrote on 21 dec 2003 in
comp.infosystem s.www.authoring.stylesheets:
Evertjan. wrote:
Padding is IMHO putting a spacing between a container and its
contents. But an img is NOT a container, so IE is right not to
construct that. It is like padding a string of letters instead of its
container.


Padding is spacing between the border and the contents. Margin is
spacing between the total width (width+padding+ border) of the element
and the container.
+++ You cannot padd(?) something around itself,
padding is an inside job. +++


That is incorrect. Especially for images the W3C box model makes
sense.
If you want padding AROUND an image, that is called a margin.


Again, incorrect.
so never use the same class for img and containers, if you want to
use things ike padding in it.


Beste Anne,

I put to you that saying that something is incorrect or makes sense will
give you a moral obligation to tell us why you think so.

I state that a IMG has no content, because it is the content itself.
IMG is no container, it cannot have a inside child, the displayed image
is just a property [or perhaps value] of the IMG.

That's why the idea of padding makes no sense. IE acts on that notion.

Border is something around the img, that can have a size of zero or
bigger and a color or other graffics, and is inside a possible margin
area. Border does not define a container.

Padding is like putting a margin around the children of an object,
remembering that the childs own margin is inside that again.

btw: If the IMG is inline [default] or box [is that possible?] should
have nothing to do with that.

Als je het er niet mee eens bent, leg dan aljeblieft uit waarom.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #6
Evertjan. wrote:

I state that a IMG has no content, because it is the content itself.
IMG is no container, it cannot have a inside child, the displayed image
is just a property [or perhaps value] of the IMG.

That's why the idea of padding makes no sense.
I'm sorry, but padding for an img element does make sense, at least to
me. I fail to see why that element should be accepted from the box model.
IE acts on that notion.
I didn't know that. But MSIE fails to implement the specs, is that
evidence of anything other than the failures of MS?
Border is something around the img, that can have a size of zero or
bigger and a color or other graffics, and is inside a possible margin
area.
And if the padding is 0, the border will be snug with the image data;
if the padding is > 0, there will be space between the image and its
border. Is there some reason why you want there to be no option here?
btw: If the IMG is inline [default] or box [is that possible?]


Do you mean block? display: block can be applied to an img element.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #7
Evertjan. wrote:
I state that a IMG has no content, because it is the content itself.
IMG is no container, it cannot have a inside child, the displayed image
is just a property [or perhaps value] of the IMG.

That's why the idea of padding makes no sense.
It does make sense -- you just have to image that the picture itself is an
anonymous child element of <img>.
IE acts on that notion.


IE acts wrong then.

If I write:

<img src="foobar" alt="Foo Bar" style="margin: 1em; padding: 1em; border:
thin solid black;">

the correct rendition is to draw the picture itself (anonymous child of
<img>), surrounded by 1em of blank space, surrounded by a thin solid black
border, surrounded by another 1em of blank space.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

Jul 20 '05 #8
Toby A Inkster wrote:
IE acts wrong then.


AFAIK, it works in IE6. Standard compliant mode on.

Example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<style type="text/css">
body{
margin:2em;
}
img{
padding:1em;
border:2em solid red;
}
</style>
<img src="" alt="padding + border test image" height="20" width="20">
--
Anne van Kesteren
<http://www.annevankest eren.nl/>
Jul 20 '05 #9
Anne van Kesteren wrote on 22 dec 2003 in
comp.infosystem s.www.authoring.stylesheets:
Toby A Inkster wrote:
IE acts wrong then.


AFAIK, it works in IE6. Standard compliant mode on.


Point for you, Anne.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #10

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

Similar topics

1
1716
by: geniolatenio | last post by:
Hello guys, I have a rather strange problem with IE (googled for it to no avail) I have these two styles in the css file, right? #menu { left:13px; padding:13px 0 14px 247px; white-space:nowrap } #menu a { padding:13px 11px 13px 11px } (I have removed some items that are not relevant to the problem)
36
3052
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/ |
1
8592
by: rdlauer | last post by:
For some time now we've been seeing seemingly random errors thrown by an application "Padding is invalid and cannot be removed". Everything I've read about this online suggests that the machine key is different between two load-balanced servers, but this application is running on just one server. The other odd thing is that the errors come in groups. Over a short period of time (5 minutes or so) many different users will hit this error...
3
5834
by: floppyzedolfin | last post by:
Hi there. I'm coding an encryption / decryption program. At this very moment, I think I should be pretty close from the end, but there's something blocking me on my way. There's a "Padding is invalid and cannot be removed" error raised when closing the cryptostream (or FlushFinalBlock-ing it). For what I have read, Padding errors are due to an incorrect padding : PKCS7 is recommended.
1
1692
by: lilOlMe | last post by:
I'm really starting to lose it on this problem. I have created 2 <div> tags that will server as boxes. While explaining my problem I will refer to these <div> tags as Boxes...to keep things simple. I'd like to draw a box with a border...have the content started 5px away from its edges. I will refer to this box as the "outter box" Then I'd like to draw another box within the box...I will refer to this box as the "inner box". The inner...
0
1582
Screaming Eagle
by: Screaming Eagle | last post by:
I haven't recieved any information that I could use, and researching this issue hasn't turned up any worthy results. Hence my reposting. Since I have had no reply, and my associates wish to move things along, I have been forced to use regular frames for the site (which works fine, but visually its not what I'd like to produce). Ideally, I would like to fix this problem I currently have with iframes, and do without using regular frames. If anyone...
13
3059
by: aarklon | last post by:
Hi all, arrays are guaranteed to be contiguous with no padding before or after any array member , but what about enums ..???
3
3866
by: vippstar | last post by:
Hey comp.lang.c I'm somewhat confused with bit padding. I tried searching the FAQ, but there isn't a search feature, so I used google and the search query: site:c-faq.com padding. I did not find anything relevant to bit padding, only byte padding for structs, which more or less I understand. All sections are from n1256
1
1563
by: dkoro | last post by:
I have a very simple page with a left menu column, and for some reason I just cannot tighten up the spacing between the <p>'s in the left column (the "Item #1" etc)...setting both margins and padding to 0 has no effect. Its driving me crazy! Currently its in a <blockquote> which I thought was the problem but removing the <blockquote> doesn't help. Any ideas? Here's the style sheet: body { font-family:Arial, Helvetica, sans-serif; ...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10147
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...
1
10090
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9949
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
8971
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
7499
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
6739
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2879
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.