Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

bottom margin in div in ie6, no bottom margin if FF or Chrome

Posted on 2009-03-30
6
Medium Priority
?
824 Views
Last Modified: 2012-06-27
I have a web page with a "container" and an image inside the container.  I am trying to get the image to display with white space on both sides but no white space on the top or bottom.  The code below works perfect in FireFox and Chrome but in Internet Explorer 6, it has a 10 pixel margin or white space below the image.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head><title>CSS Rounded Corners Revisted</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>
* {
padding: 0px;
margin: 0px;
}
html {
overflow-y: scroll; /* scrollbar fix */
}
body {
margin: 0px;
padding: 0px;
background-color: #023568;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 100%;
padding: 0px 0px 0px 0px;
}
 
#container {
background-color: #FFFFFF;
font-size: 0.75em;
overflow: hidden;
width: 580px;
margin: 0 auto;
}
* html #container {
height: 1%;
}
 
.tl {
background-image: url(circle-white-blue.jpg);
width: 10px;
height: 10px;
float: left;
font-size: 0;
}
.tr {
background-image: url(circle-white-blue.jpg);
background-position: 10px 0px;
width: 10px;
height: 10px;
float: right;
font-size: 0;
}
.bl {
background-image: url(circle-white-blue.jpg);
background-position: 0px 10px;
width: 10px;
height: 10px;
float: left;
font-size: 0;
}
.br {
background-image: url(circle-white-blue.jpg);
background-position: 10px 10px;
width: 10px;
height: 10px;
float: right;
font-size: 0;
}
</style>
</head>
<body>
<div id="container">
<span class="tl"></span><span class="tr"></span>
<div style='width: 425px; height:344px; margin-left: auto; margin-right: auto; margin-bottom: 0px;'>
<img src="images/mano-logo-videosNEW425x344.jpg" width="425" height="344">
</div>
<span class="bl"></span><span class="br"></span>
</div>
</body>
</html>

Open in new window

0
Comment
Question by:RC123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 

Author Comment

by:RC123
ID: 24019684
Sorry, I forgot to include the image files needed to view the htm properly.
circle-white-blue.jpg
mano-logo-videosNEW425x344.jpg
bad-bottom-margin.JPG
what-it-should-look-like.JPG
0
 
LVL 30

Expert Comment

by:LZ1
ID: 24019943
The first thing I would recommend is making a separate ID for the image DIV.  And then putting your CSS in their rather than inline.  
let me know if that works. I tried it on my end, and it looked ok.
0
 

Author Comment

by:RC123
ID: 24020684
Do you mean like this: ??

background-image: url(circle-white-blue.jpg);
background-position: 10px 10px;
width: 10px;
height: 10px;
float: right;
font-size: 0;
}

#logoImage {
style='width: 425px;
height:844px;
margin-left: auto;
margin-right: auto;
}
</style>
</head>
<body>
<div id="container">
<span class="tl"></span><span class="tr"></span>
<div id="logoImage">
<img src="images/mano-logo-videosNEW425x344.jpg" width="425" height="344">
</div>
<span class="bl"></span><span class="br"></span>
</div>
</body>
0
Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

 
LVL 30

Expert Comment

by:LZ1
ID: 24020760
Yes, just like that.
0
 

Author Comment

by:RC123
ID: 24020966
It doesn't work in IE 6.0
0
 

Accepted Solution

by:
RC123 earned 0 total points
ID: 24139393
I think that maybe this cannot done because the various browsers are too different.
0

Featured Post

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Find out what you should include to make the best professional email signature for your organization.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question