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

IE/CSS question: second DIV has negative margin

Can anyone tell me why, in this example, the second <div
class="content"> gets rendered differently from the (identical) first?
This only happens in IE6; Firefox renders it as I would expect.

<html>
<head>
<title>Test</title>
<style type="text/css">
body {
margin: 0; padding: 0;
}
#main {
margin: 0 auto;
padding: 0;
width: 30em;
}
#main .subsection {
margin: 0 0 1em 0;
border: 2px solid black;
}
#main .subsection .content {
margin: 0; padding: 1ex;
border-left: 2em solid yellow;
}
</style>
</head>

<body>
<div id="main">

<div class="subsection">
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Phasellus scelerisque gravida nibh. Pellentesque auctor urna
suscipit leo.</p>
</div>
</div>

<div class="subsection">
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Phasellus scelerisque gravida nibh. Pellentesque auctor urna
suscipit leo.</p>
</div>
</div>

</div>
</body>
</html>

Mar 11 '06 #1
2 1401
Kevin Cheung wrote:
Can anyone tell me why, in this example, the second <div
class="content"> gets rendered differently from the (identical) first?
This only happens in IE6; Firefox renders it as I would expect.


Answering my own question:

http://www.positioniseverything.net/explorer/creep.html
http://www.satzansatz.de/cssd/onhavinglayout.html

Mar 11 '06 #2
On 2006-03-11, Kevin Cheung <ke*******@gmail.com> wrote:
Can anyone tell me why, in this example, the second <div
class="content"> gets rendered differently from the (identical) first?
This only happens in IE6; Firefox renders it as I would expect. <html>
<head>


quirks mode?

--

Bye.
Jasen
Mar 12 '06 #3

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

Similar topics

3
by: [H]omer | last post by:
What is the property that defines the difference between the line-hight and the font-size? E.g.: I have two <div>'s with no properties set at all. I then give the second div a left margin...
49
by: Mark Moore | last post by:
It looks like there's a pretty serious CSS bug in IE6 (v6.0.2800.1106). The HTML below is validated STRICT HTML 4.01 and renders as I would expect in Opera, FrontPage, and Netscape. For some...
2
by: Xah Lee | last post by:
is there a way to do negative indent for paragraphs, as in a dialogues? (i.e. in Microsoft word, drag the top margin triangle to the left, bottom to the right, then press tab after each person's...
21
by: yeti349 | last post by:
Hi, I'm using the following code to retrieve data from an xml file and populate a javascript array. The data is then displayed in html table form. I would like to then be able to sort by each...
0
by: BACON | last post by:
I'm just starting the process of reorganising my modest little website and cleaning up all the HTML, and the logical place to begin was with the homepage. I made a simple little ASP.NET control...
5
by: BACON | last post by:
I'm just starting the process of reorganising my modest little website and cleaning up all the HTML, and the logical place to begin was with the homepage. I made a simple little ASP.NET control...
2
by: dave8421 | last post by:
Hi, I am reading CSS 2.1 draft specification: http://www.w3.org/TR/2006/WD-CSS21-20061106/ Part of section 10.3.3 (Block-level, non-replaced elements in normal flow) reads: If there is...
4
by: pedrito | last post by:
I have a regex question and it never occurred to me to ask here, until I saw Jesse Houwing's quick response to Phil for his Regex question. I have some filenames that I'm trying to parse out of...
1
by: Jeremy | last post by:
Hi all, I have a container which I want to have a consistant gap around the edges before any content starts. The obvious way to do this is the padding style. However, anything with a margin...
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
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.