Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

image padding problem - CSS

Status
Not open for further replies.

enderws

Programmer
Aug 10, 2002
2
0
0
US
I'm trying to solve a discrepancy between Mozilla and IE. Using this code (available at

<html>
<head>
<style>
.imageviewbox {
margin-top: 10px;
margin-bottom: 10px;
margin-left: auto;
margin-right: auto;
text-align: center;
}
.imageviewbox img {
border: 1px dotted #842424;
padding: 10px;
background: #FFF;
}
</style>
</head>
<body bgcolor=&quot;#CCCCCC&quot;>
<div class=&quot;imageviewbox&quot;>
<img src=&quot;</div>
</body>
</html>

IE for PC does NOT draw a padding around the image. Mozilla DOES. How can I get IE to draw a padding around it? This code will be used with some PHP that sticks different size images into the box, so I can't set static widths and such. Any help would be appreciated.
 
Has anyone had a colution to this behavior? This person posted two years ago and no one answered then...

Now I have the problem and I'd love to get it solved.

TIA

--Shelle
 
Whow... blast from the past.

Just get IE out of quirks mode (with proper DTD).

If you have to support IE5.5 and older, things are a little bit more complicated but still solvable.
 
Well, you ARE right but the new can of works is which DTD supports both browsers? I'm playing and keep losing one browser or the other.

Any idea which works in both? Not concerned so much with older browsers.

BTW, you rock - thanks!

--Shelle
 
Thanks for the page! Yup - a good one indeed. Now of course, I've blown out the NS compatibility, but hey - I was more concerned with IE and I know I'll get it all back :)

Thanks.

--Shelle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top