473,770 Members | 3,912 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 2419
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
2031
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
5511
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
2762
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
8845
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
1299
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
3074
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
7458
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
2585
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
9602
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10237
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
10071
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
10017
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
9882
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
8905
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, and deployment—without 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...
0
6690
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();...
1
3987
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
3
2832
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.