473,382 Members | 1,202 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,382 software developers and data experts.

Curious IE "feature"

2
A curious problem I've encountered which can be seen with a simple piece of HTML:

Expand|Select|Wrap|Line Numbers
  1.  <div id="a" style="position: absolute; top:5px; left: 5px; width:100px; height:100px; border: 1px solid red;">
  2.     <div id="b" style="position: absolute; top:0px; left: 0px; width:100px; height:99px; border: 1px solid red;"></div>
  3.     <div id="c" style="position: absolute; top:99px; left: 0px; width:100px; height:1px; border: 1px solid red;"></div>
  4. </div>
  5.  
  6. <br /><br /><br /><br /><br /><br /><br />
  7.  
  8. <script type="text/javascript">
  9.     document.writeln("style height: "+ document.getElementById("c").style.height+"<br />");
  10.     document.writeln("client height: "+document.getElementById("c").clientHeight+"<br />");
  11.     document.writeln("offset height: "+document.getElementById("c").offsetHeight+"<br />");
  12. </script>
This is supposed to generate 3 divs: a 100x100 box containing to more boxes, the first 99x100 in size, the second 1x100 in size. This is not what happens with IE 6.0, though (i haven't tested IE 7.0 yet). In Firefox 2.0 and Opera 9 works as you would expect, viewing in IE 6.0 expands the second inner div to 19px or so..

I have no idea what is going on here... I tried a few extra style attributes (like line-height:0px) but haven't found anything to remedy the situation...

Inspecting the DOM, IE shows the correct style attributes (i.e. height: 1px) but theclientHeight and offsetHeight attributes are both 15px...

You can see images of what is displayed here:
http://blog.bluecaldera.com/2006/11/...s_ie_feat.html

Any help would be greatly appreciated!

Thanks
Nov 11 '06 #1
1 1325
titch
2
A curious problem I've encountered which can be seen with a simple piece of HTML
OK, problem solved!

Adding a "line-height:0px" property to div C solved the problem. I am certain I tried this before, but I tried it again whilst playing around with some other properties, and it worked this time.. I have no idea why it didn't work the first time!

Adding "overflow: hidden" also does the trick.
Nov 12 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Jordan Rastrick | last post by:
First, a disclaimer. I am a second year Maths and Computer Science undergraduate, and this is my first time ever on Usenet (I guess I'm part of the http generation). On top of that, I have been...
1
by: Tobias | last post by:
Need help: In Visual C++ 6 there was a feature "function called by" which could be reached by right-mouse-button-clicking on a function in the class view. I can't find the feature in .NET. Does it...
3
by: laredotornado | last post by:
Hello, I have a simple login script. I have the pages login.php login_response.php login_success.php login_failure.php What I want to do is have a checkbox on the login.php page where if...
2
by: google | last post by:
Hello everyone, I am having an issue using the "Multi Select" option in a list box in MS Access 2003. I am making a form that users can fill out to add an issue to the database. Each issue can...
1
by: stax | last post by:
Hello, I would like to add a Send Feedback feature to my application. Does anybody know or easy way to do this, any applications that do this, articles, samples or anything else that could give me...
5
by: Alain Filiatrault | last post by:
Hi, I need to implement a "form.dirty" feature on a VB .NET form not related to a database. I need to know if any of the items (Textboxes, combo, listboxes, ...) was changed. Is there a quick...
1
by: Bradley Burton | last post by:
My friend has made a webpage that's kind of like myspace. He wants to make a feature similiar to the 'tag a photo' feature that's in facebook. This feature allows a person to upload a pic which...
4
by: Jean-Fabrice RABAUTE | last post by:
Hi, I am happy to announce the release of the Companion.JS v0.2, an alpha version to a Javascript debugger for IE : http://www.my-debugbar.com/wiki/CompanionJS/HomePage The main new feature...
1
by: mohini2000 | last post by:
Hi I want to implement a "Remember Me" feature in a website that basically keeps users logged into the website, even after they've closed the browser so that the next time they come, they won't...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.