473,399 Members | 3,106 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,399 software developers and data experts.

Getting <div> 1px height on IE6?

For some reason IE6 does inserts a minimum default height of a div. I'm
trying to set a height:1px; which works fine on Mozilla.
Does anyone know how to get IE to display the same 1px div height?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

..spacer {
height:1px;
background: lime;
margin-top:10px;
margin-bottom: 10px;
}

<div class="spacer"></div>

Nov 7 '05 #1
3 21993
Els
Timmy wrote:
For some reason IE6 does inserts a minimum default height of a div. I'm
trying to set a height:1px; which works fine on Mozilla.
Does anyone know how to get IE to display the same 1px div height?


Set the line-height to 1px as well.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Nov 7 '05 #2
"Els" <el*********@tiscali.nl> wrote in message
news:13***************@locusmeus.com...
Timmy wrote:
For some reason IE6 does inserts a minimum default height of a div. I'm
trying to set a height:1px; which works fine on Mozilla.
Does anyone know how to get IE to display the same 1px div height?


Set the line-height to 1px as well.


Or overflow:none - that will also do the trick
Nov 8 '05 #3
put comments in the div

eg.

<div class="spacer"><!-- --></div>

--
Martin Eyles
ma**********@NOSPAM.bytronic.com
"Timmy" <sp****@mailinator.com> wrote in message
news:dk*************@news.t-online.com...
For some reason IE6 does inserts a minimum default height of a div. I'm
trying to set a height:1px; which works fine on Mozilla.
Does anyone know how to get IE to display the same 1px div height?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

.spacer {
height:1px;
background: lime;
margin-top:10px;
margin-bottom: 10px;
}

<div class="spacer"></div>

Nov 9 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jens Kristensen | last post by:
I have a problem displaying a divbox containing a html-textarea - everything works fine with "normal" characters. However, when the textarea contains special chars like <P> or ' , the box fails to...
4
by: nick | last post by:
The structure is very simple: <div style="WIDTH: 500px; HEIGHT: 50px; BACKGROUND-COLOR: aqua"> <div id="nav"> <a href="#">menu1</a> </div> </div> I want to let the "nav" div sink at the...
0
by: geod | last post by:
Folks, I'm relatively new to design all-css sites and have hit upon a snag. I'm sure it's something simple, but I haven't wrapped my mind around i yet. Here's the thing: My css file...
44
by: Jim M | last post by:
I have had great success with using <iframe> with overflow-y set to auto. I can get a similar look with the <iframe> tag. BUT... In all cases I need to have fixed heights. Is there a way to...
6
by: Don Sutter | last post by:
Hi all, I'm using Javascript to try to determine the final height of a division so that I can use that value in calculations to set the height of another division and also my body height. I'm...
1
by: P Nishanthan | last post by:
Hi, I have a datagrid inside the DIV. If the datagrid height is more than 100px, i have to show the scroll bar in the DIV. Otherwise DIV height should be same height as datagrid. How can i do...
15
by: scott | last post by:
Hello, I'm working on updating some of my table-based sites to use CSS instead of tables. One of my sites has a header that is composed of three elements: A B C In my prior design, this was...
5
nathj
by: nathj | last post by:
Hi All, I'm working on a new site that has a two column layout underneath a title bar. If you check out: http://www.christianleadership.org.uk/scratch/mainpage.php using IE or Opera you will...
8
prino
by: prino | last post by:
Hi all, I've written code (in REXX) that takes files in legacy languages (PL/I, COBOL, z/OS assembler, etc) and converts them into HTML in a format similar to what's displayed in the z/OS ISPF...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.