Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Another IE6 Bug, any ideas?

Featured Replies

I'm trying to build a website for a newly formed charity. I'm no expert and would appreciate some help if anyone has any ideas.

 

The page has a logo and banner image at the top. A nav bar across the bottom of those and a three columns layout beneath that. In Fifefox all is ok but in IE6 there is a 2-3px gap between the the banner image and the nav bar image below. Any ideas why and how to get rid of it?

 

Below is the html and css and I've attached the images as well. thanks

 

HTML

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Untitled Document</title>

<link rel="stylesheet" type="text/css" media="screen" href="default.css" />

</head>

 

<body>

<div id="wrap">

<div id="head">

<div id="banner"><img src="images/banner6.jpg" alt="uh" width="600" height="149" />

</div><!-- end banner -->

</div><!-- end head -->

<div id="navbar">

 

</div><!-- end navbar -->

 

<div id="maincontent">

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

</div><!-- end maincontent -->

 

<div id="rightcontent">

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

</div><!-- end rightcontent -->

 

<div id="leftcontent">

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

</div><!-- end leftcontent -->

 

</div><!-- end wrap -->

</body>

</html>

 

CSS

 

html {

font-size:100.01%;

padding:0;

margin:0;

height:100%;

}

 

body {

margin:0;

padding:0;

font:.9em Verdana, Helvetica, Georgia, Sans-serif;

background-color:#84a67a;

}

 

h1,h2,h3,h4,h5,h6 {margin:5px;font-family:"Courier New", Courier, monospace;}

 

img {border:0;}

 

p {text-align:justify;}

 

#wrap {

width:749px;

color:#fff;

margin:0 auto;

}

 

#head {

height:149px;

background:url("images/logo.gif") no-repeat;

margin:0;

padding:0;

}

 

#head #banner {

float:right;

}

 

#navbar {

height:50px;

background:url("images/navbar.gif") repeat-x;

margin:0;

padding:0;

}

 

#maincontent {

position:absolute;

background-color:#ccc;

left:338px;

width:320px;

}

 

#leftcontent {

text-align:center;

background-color:#0000ff;

padding:10px;

width:170px;

}

 

#rightcontent {

background-color:#0000ff;

text-align:center;

float:right;

width:180px;

padding:10px;

}

post-8919-1228988443_thumb.jpg

post-8919-1228988453_thumb.gif

post-8919-1228988461_thumb.gif

It's nice to be in complete control of your code and what it's doing. But 2-3 pixels, whats the issue (unless it's breaking the layout of the site, which you've not said).

 

IE is a pain and often throws these at you, could be one of a number of issues. It could be something like the double margin bug (only it's not).

IE6 is a pain, especially when you want things positioned flush! But if the problems only with IE6, why don't you create a separate stylesheet for IE6? Insert this if statement link tag <!--[if IE 6]> <link href="IE6.css" rel="stylesheet" type="text/css"> <![endif]--> into your HTML and the new stylesheet overrides your main CSS page just for IE6. This is what I do to fix transparency issues anyway

It's nice to be in complete control of your code and what it's doing. But 2-3 pixels, whats the issue (unless it's breaking the layout of the site, which you've not said).
If even 1 px bothers you as a designer then it can be an incredible annoyance and actually spoil the look of a design that needs to be perfectly tight. 2-3 pixels is too much to tolerate and there are ways around the problem anyway. Sometimes, perfection is absolutely essential. ;)

 

I did find a fix for this once but have forgotten where I got it from. The source was Google though so a bit of research will probably sort this for you.

 

EDIT

Just noticed what LYKC posted as I was still writing and that is one of the most common solutions as well as an excellent idea - using conditional statements to link to a separate stylesheet.

Yea I did say "unless it's breaking the layout of the site". ;)

Yea I did say "unless it's breaking the layout of the site". ;)
@Mesa: You sure did. My bad. I missed that in my haste as in a blinding hurry to get out of the office atm. Thanks for pointing that out. :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.