Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Why doesn't IE 6 understand "1px" ?
Old 09-30-2007, 01:12 AM Why doesn't IE 6 understand "1px" ?
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
<div style="height:1px; border:0; margin:0; padding:0; background-color:Black;"></div>

This is 77 pixels in height. In production, IE 7 uses this code works the way it should, and does in Firefox 2. In IE 6, it always looks like this. Any thoughts why? Or what I can do to fix it?
Attached Images
File Type: jpg Render.jpg (20.2 KB, 19 views)
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
 
Register now for full access!
Old 09-30-2007, 01:16 AM Re: Why doesn't IE 6 understand "1px" ?
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Add overflow: hidden; to your div. That works in everything. LNR may know why IE6 does it; I never have. I just figured out that I needed to add overflow: hidden; to it after messing about with similar stuff one day.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 09-30-2007, 06:18 AM Re: Why doesn't IE 6 understand "1px" ?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,381
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
IE6 adds height to an empty div to make space for the text you are not going to put in it.

Add font-size:1px to the definition
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 09-30-2007, 11:03 AM Re: Why doesn't IE 6 understand "1px" ?
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
My question is -- why have a 1px high div in the first place ??? Why not use a border instead of a pointless div ?
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 10-01-2007, 10:20 AM Re: Why doesn't IE 6 understand "1px" ?
rozehrocks's Avatar
Novice Talker

Posts: 9
Name: Mary Roselyn Reyes
Trades: 0
I had a problem like this a while ago. thanks for the solution guys.
rozehrocks is offline
Reply With Quote
View Public Profile Visit rozehrocks's homepage!
 
Old 10-02-2007, 12:24 AM Re: Why doesn't IE 6 understand "1px" ?
Junior Talker

Posts: 3
Name: aspar
Trades: 0
hi,

i have tried this code and work fine there is no problem. see below:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<div style="height:1px; border:0; margin:0; padding:0; background-color:Black;"></div>
</body>
</html>
aspar is offline
Reply With Quote
View Public Profile
 
Old 10-02-2007, 01:06 AM Re: Why doesn't IE 6 understand "1px" ?
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
Quote:
Originally Posted by LadynRed View Post
My question is -- why have a 1px high div in the first place ??? Why not use a border instead of a pointless div ?
There are a couple of tables below, and two divs above it. There's no single object to give a border to, and this seems easier than attaching borders to the stuff above and below. It's an asp site with the code spread across a few hundred pagelets, so it'll take a while to get rid of the tag soup that's rendered.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 10-02-2007, 01:59 AM Re: Why doesn't IE 6 understand "1px" ?
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
There is another option...since it is a line as such, you could use the hr tag and style it similarly in CSS. I do that every so often.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Reply     « Reply to Why doesn't IE 6 understand "1px" ?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.57796 seconds with 13 queries