473,747 Members | 3,014 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 22013
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*********@ti scali.nl> wrote in message
news:13******** *******@locusme us.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**********@NO SPAM.bytronic.c om
"Timmy" <sp****@mailina tor.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
6519
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 show: function show(divbox) { divbox.style.display=''; } <div id="divbox" style="display:none" >
4
8213
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 bottom of the aqua color div. I tried to make the "nav" div 100% height and set "vertical-align:
0
1928
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 contains definitions for two divs that are meant to liv side-by-side in the page layout. Both are floated left. Both have th
44
919
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 put either tag inside an HTML <TD> and have the same kind of scrolling effect. This would allow me to fill the screen and have the size of the scrolling box change on resize. Thanks in advance.
6
5478
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 using the term: var foo = document.getElementById('contentFrame').style.height; to try to access the height value. Nothing seems to be returned. I can
1
1330
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 this? Thanks in advanve. Nishanthan
15
2261
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 done using a table. A, B, and C were each <tdelements.
5
5263
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 see what I am after as these browsers work fine. However, in FF the results are slightly different - take a look and you'll see that the <p>, within <div class="mainContent"> has shot way over to the right. I've been working on this for 2days now...
8
10047
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 editor. A fellow member of the PCG has helped me by creating a bit of Javascript to emulate the scrolling and using Google I've now gotten it into a state where it almost passes the W3C Markup Validation Service. However, the one error, Error Line 166,...
0
9522
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9354
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9307
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9223
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8233
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6790
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6067
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4860
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2771
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.