473,840 Members | 1,659 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

borders of collapsed block disappear

This may seem a pointless question, but I'm trying work around an
inconsistency between browsers.

I have a template that contains a division that holds a text that
sometimes exists and sometimes not. I use top and bottom borders to
separate this material from its environment:

.header {
font-size: smaller;
border-bottom: solid black thin;
border-top:solid black thin;
margin-top: 0.2em;
margin-bottom: 0.2em;
}

...

<div class="header">
<p>
header text...
</p>
</div>

When there is no text to use as a header, I remove the paragraph
container (so that the division completely collapses). On one browser,
the two borders nicely converge to become a single line, which is what
I want. But on IE5, the border simply disappears.

How can I get IE5 to print the border even though there's nothing in
the division container?
--
Haines Brown
br****@hartford-hwp.com
kb****@arrl.net
www.hartford-hwp.com

Jul 20 '05 #1
2 2422
In article Haines Brown wrote:
This may seem a pointless question, but I'm trying work around an
inconsistency between browsers.

I have a template that contains a division that holds a text that
sometimes exists and sometimes not. I use top and bottom borders to
separate this material from its environment:
[snip code]
When there is no text to use as a header, I remove the paragraph
container (so that the division completely collapses). On one browser,
the two borders nicely converge to become a single line, which is what
I want. But on IE5, the border simply disappears.

How can I get IE5 to print the border even though there's nothing in
the division container?


Try printing <!-- comment --> in place of content. May work, or may not.
(there is cases where this does help IE5 to get things right.)

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

Jul 20 '05 #2
Lauri Raittila <la***@raittila .cjb.net> writes:
In article Haines Brown wrote:
This may seem a pointless question, but I'm trying work around an
inconsistency between browsers.

I have a template that contains a division that holds a text that
sometimes exists and sometimes not. I use top and bottom borders to
separate this material from its environment:


[snip code]
When there is no text to use as a header, I remove the paragraph
container (so that the division completely collapses). On one browser,
the two borders nicely converge to become a single line, which is what
I want. But on IE5, the border simply disappears.

How can I get IE5 to print the border even though there's nothing in
the division container?


Try printing <!-- comment --> in place of content. May work, or may not.
(there is cases where this does help IE5 to get things right.)


Good thought, but unfortunately, does not work. I also tried the same
by using <p class=... >... instead of <div class=...><p>.. ., but a
paragraph suffers the same fate as a division: without content, it
looses its borders; with content, the borders don't converge.

I even tried this:

div.Z1 { border-top: solid thin; }
div.Z2 { border-bottom: solid thin; }

Oddly, each div here creates a line which is entirely independent of
the other, but if one div immediately follows the other, the lines
disappear!

I found a solution to the problem, but it creates another problem in
IE5:

div.Z1 {
height: 1px;
background-color: black;
}
div.Z2 {
height: 1px;
background-color: black;
}
...
<div class="Z1"></div>
<!-- no content -->
<div class="Z2"></div>

<div class=Z1"></div>
<p>Content</p>
<div class="Z1"></div>

This looks ugly on paper, but works nicely with my usual browser
(galeon). But when it comes to IE5, while I do now get a single line
with no content, and I get lines above and below some content, for
some odd reason, IE5 won't allow me to create a block that is 1 pixel
high. Instead, the single lines look like, say, 1 em, and the double
line is twice as thick. Is this minimum block size a known behavior of
IE5? This approach would probably work under IE5 if I could figure out
how to create a 1px high box.

I tried definining line-height as 0 em in Z1 and Z1, but no effect. I
tried to use a 0.5px border instead of background-color. This time,
with or without content, the line disappears as before.

--
Haines Brown

Jul 20 '05 #3

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

Similar topics

1
2035
by: David Walker | last post by:
Can someone please confirm my suspicion that IE5 on Windows is including borders in the dimensions of a block object? The block in question has the following css: div.headerbox { position: relative; left: 169px; height: 70px; margin: 5px;
4
5514
by: David Ross | last post by:
In my <http://www.rossde.com/inflation.html>, I have a small table in the middle of the page. This page is composed without a DOCTYPE statement at the beginning. The table borders appear to my browser (Mozilla) as raised with a slight shadow to the right and below. The borders are specified with the "border" attribute in the <table> tag: <table border cellpadding=2 width="100%"> and not via a style sheet. If I add a DOCTYPE...
7
2765
by: NeverLift | last post by:
I posted a very long message regarding my experiences with JavaScript, one reply was posted asking I post an example of the problem -- and both are gone! Is there a moderator that removes such stuff? In any case, here is the issue in brief: I want to keep the page invisible while my onload script decides how to format it, setting colors, downloads images, etc. The style "visibility:hidden" in the body tag almost does it -- except...
2
8856
by: Jacob | last post by:
I'm trying to create an MDI form where the MDI area dosn't have the traditional 3D borders. I thought at one point the code I had in the form constructor was working, but now I'm getting an MDI without borders, but the main menu on my form no longer appears. Anybody who has a little more experience with this and is willing to help, I would appreciate it. Thanks, Jacob
2
1302
by: 50295 | last post by:
Hello, I'm building a menu for a page, like this (snippet): <td align="center"> <a href="#" style="display:block">Contact</a> </td> As a result, I get nice clickable tabs. However, there's the not-so-nice problem of unsightly borders shown here:
2
3088
by: Rick | last post by:
Let me start by saying that I know very little about JavaScript. The software that I use to convert my FrameMaker files to HTML uses a JavaScript to hide certain text. The user has to click the paragraph to display that text. Currently, that collapsed text prints only if I go ahead and expand it on my HTML page. I want to be able to have that text automatically print, regardless of whether the user has expanded it on the HTML page.
11
7466
by: Schraalhans Keukenmeester | last post by:
I have tried to collapse a long part of a text on my weblog using the following construct: <style> div.expand { display : none; } div.expand:hover (display : inline; } div.expand em {display : inline; } </style> <p>Blablabla etc lorem ipsum yadayada</p>
15
2590
by: Davo | last post by:
Hello, I've created a table with two columns, the second column is fixed width at 64px and contains a div, the div has a border and contains some text, the text renders to larger than 64px. This is a cut down version of a more complex page to illustrate the problem so just changing it to divs or some such wont help. In IE6 and FF2 the div border automatically stretches to contain the text, in IE7 the div is set to 64px and stays...
0
9699
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10924
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
10605
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
10665
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,...
1
7839
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
7023
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
5685
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.