473,388 Members | 1,480 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

IE isn't spacing my divs properly

Curtis Rutland
3,256 Expert 2GB
OK, I'm sure this is probably me just being a noob to CSS, but I'm running into a problem. I'm using images to give the appearances of rounded corners to a div, but for some reason, IE7 is still putting some space between the "mainContent" div and the "capBottom" div. Firefox and Opera render it the way I want.

Here's an image of what's wrong:


Here's what it looks like in Firefox:



Heres the HTML:
Expand|Select|Wrap|Line Numbers
  1. <div id="container">
  2.     <div id="nav">
  3.         <div id="navBanner">
  4.             <asp:Image ID="longLogo" runat="server" ImageUrl="~/images/banner.png" />
  5.         </div>
  6.         Links will go here
  7.     </div>
  8.     <div id="content">
  9.         <div id="right">
  10.             <div id="capTop">
  11.                 <asp:Image ID="imgCapTop" runat="server" ImageUrl="~/images/roundCapTop.png" />
  12.             </div>
  13.             <div id="mainContent">
  14.                 Content will go here
  15.             </div>
  16.             <div id="capBottom">
  17.                 <asp:Image ID="Image1" runat="server" ImageUrl="~/images/roundCapBottom.png" />
  18.             </div>
  19.         </div>
  20.     </div>
  21. </div>
  22.  
Here's the stylesheet:
Expand|Select|Wrap|Line Numbers
  1. body
  2. {
  3.     font-family: Calibri;
  4.     background-color: #d4d5d5;
  5.     background-image: url( '../images/backgrad.jpg' );
  6.     background-repeat: repeat-x;
  7. }
  8.  
  9. #right
  10. {
  11.     float: left;
  12.     width: 770px;
  13.     min-height: 600px;
  14.     padding-left: 15px;
  15.     padding-right: 15px;
  16.     background-color: Transparent;
  17.     display: inline;
  18. }
  19. #nav
  20. {
  21.     font-size: 13px;
  22.     height: 100px;
  23.     text-align: center;
  24.     width: 788px;
  25.     background-color: transparent;
  26.     margin-bottom: 20px;
  27. }
  28. #navBanner
  29. {
  30.     text-align: right;
  31. }
  32. #container
  33. {
  34.     clear: both;
  35.     margin-top: 15px;
  36.     width: 800px;
  37.     margin-left: auto;
  38.     margin-right: auto;
  39. }
  40. #content
  41. {
  42.     clear: both;
  43.     margin-top: 15px;
  44.     width: 800px;
  45. }
  46. #capTop
  47. {
  48.     width: 770px;
  49.     height: 12px;
  50.     background-color: Transparent;
  51.     margin-bottom: 0px;
  52. }
  53. #capBottom
  54. {
  55.     margin-top: 0px;
  56.     width: 770px;
  57.     height: 12px;
  58.     background-color: Transparent;
  59. }
  60. #mainContent
  61. {
  62.     margin-top: 0px;
  63.     background-color: White;
  64.     margin-bottom: 0px;
  65.     width: 770px;
  66.     min-height: 550px;
  67. }
  68.  
So what am I doing wrong? Is there some IE specific stuff I need, or am I just missing something?
Jul 31 '08 #1
5 1322
drhowarddrfine
7,435 Expert 4TB
Yes, this is an IE-bug bug I need a minute to try and remember how to fix it.
Jul 31 '08 #2
drhowarddrfine
7,435 Expert 4TB
I was trying to find my rounded corner images to emulate your markup but can't get to them. There are 2 possibilities but I can't test them. All are IE bugs. (Man, I'm starting to forget some things while I'm off doing C-coding.)

1) Make sure there is no whitespace between the end of the <img> tag and the next tag.

2) See if making margins/padding of the image and/or its container have bottoms set to 0.

EDIT: Also, try setting the <img> to 'display:block'
Jul 31 '08 #3
Curtis Rutland
3,256 Expert 2GB
1) Make sure there is no whitespace between the end of the <img> tag and the next tag. '
OK, seriously. That is a ridiculous bug! Why should whitespace affect the markup!

But this was the solution. Thanks a whole lot.
Jul 31 '08 #4
drhowarddrfine
7,435 Expert 4TB
Because all versions of IE are the worst browsers on the planet with no relief in sight.
Jul 31 '08 #5
Curtis Rutland
3,256 Expert 2GB
Oh, I know. I just remember from the very first lesson in HTML that I got was that whitespace didn't matter...and then I find this ridiculous bug 8 years later ='(
Jul 31 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Poonam | last post by:
Hi there. How can i maintain the spacing between to divs if palced side by side with 10px spacing between them.. Not using any tables. And atleast making one of the div relative positioning. ...
0
by: Olly | last post by:
I am using the following pure css layout with a header and footer: http://www.fu2k.org/alex/css/layouts/3Col_NN4_FMFM.mhtml The left column floats to the left of the main content (middle...
7
by: Danny | last post by:
I have a small <div> element which contains two text blocks - one within <h5> tags and the other within <p> tags. I don't want any extra line spacing between elements so use the display:inline...
4
by: Mimo Zus | last post by:
I'm hoping that someone can explain what's going on; better yet provide a workaround. I'm designing a centered CSS site based on a 550 pixel wide vertical background image. Onto this background...
6
by: skeeterbug | last post by:
please check out http://www.geocities.com/operationsengineer1/test2.htm how come there is spacing between my logoheader and the tabs? i'm also seeing ie6 input an extra 1em of vertical...
5
by: S | last post by:
Whew! Thanks for your help on that last post. I actually understand what you wrote. I'm trying not to use these groups as a way to get my code written for me, I really want to understand what...
6
by: =?Utf-8?B?Tkg=?= | last post by:
Hi, What do you recommend for defining the layout of an asp.net 2.0 page? Leaving masterpages and user controls aside for the moment is the use of tables or Divs the best approach? I have...
6
by: greynium | last post by:
hi Please see http://thatshindi.oneindia.in in Firefox and IE7. The spacing between the lines are different. What we see in Firefox is what we desire. How do we fix things to make it look...
4
Curtis Rutland
by: Curtis Rutland | last post by:
Sorry, me again. Now I have the opposite problem. Actually, I'm fairly certain Firefox is spacing them right, I just can't see what is wrong with my code. I've got the site live at...
5
by: warp | last post by:
With some help from a friend I made a layout for this website: http://jwstolk.xs4all.nl/roelof/ (don't mind all the unfinished junk, the home page is of concern) In FF 3 it shows just fine,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
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...

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.