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

Box model problem

Hi
Why firefox and Opera puts, between the div <div id="menuHoriz"and the
following div "main", a horizontal space of 16px , only in this case ?

I don't want a space between "menuHoriz" and "main" div... and if set the
margin-top: -16px this result not a good workaround for IE 6.
thanks
Here is the code (very simple)
=====================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>XXXX</title>

<style>
body{
background:url(img/sfondoBody.jpg) repeat-x;
background-color:#8DB9E4;
margin: 0px 0 0px 20%;
}

#container{
width:787px;
position: relative;
}

#Logo{
width:787px;
height:113px;
background-color:#006699;
}

#tst1{
width:787px;
height:179px;
background-color:#0099CC;
}

#menuHoriz{
width:787px;
height:45px;
background-color:#FFCC00;

}

#main{
width:787px;
height:200px;
background-color:#FFFFFF;

}

</style>

</head>

<body>
<div id="container">
<div id="Logo"></div>
<div id="tst1"></div>
<div id="menuHoriz">horizontal menu</div>
<div id="main"><p>here the text of my page</p></div>
</div>
</body>
</html>
Apr 11 '07 #1
4 1513
"Rataplan" <mi************@Levamisimplogic.itwrites:
Hi
Why firefox and Opera puts, between the div <div id="menuHoriz"and the
following div "main", a horizontal space of 16px , only in this case ?
Because you are using the default margin-top for <p>, probably

--
Jón Fairbairn Jo***********@cl.cam.ac.uk

Apr 11 '07 #2
On 2007-04-11, Rataplan <mi************@Levamisimplogic.itwrote:
Hi
Why firefox and Opera puts, between the div <div id="menuHoriz"and the
following div "main", a horizontal space of 16px , only in this case ?

I don't want a space between "menuHoriz" and "main" div... and if set the
margin-top: -16px this result not a good workaround for IE 6.
What J?n Fairbairn said. Note that top margins can collapse against top
margins of descendent elements which can be a bit confusing. Use p {
margin-top: 0; }
Apr 11 '07 #3
thanks Jon !
it's true.
:-)

by
"Jón Fairbairn" <jo***********@cl.cam.ac.ukha scritto nel messaggio
news:wf************@calligramme.charmers...
"Rataplan" <mi************@Levamisimplogic.itwrites:
>Hi
Why firefox and Opera puts, between the div <div id="menuHoriz"and the
following div "main", a horizontal space of 16px , only in this case ?

Because you are using the default margin-top for <p>, probably

--
Jón Fairbairn Jo***********@cl.cam.ac.uk

Apr 11 '07 #4
Thank Ben !
I wrote p { margin-top: 0; } and now is Ok !

by
:-)
"Ben C" <sp******@spam.eggsha scritto nel messaggio
news:sl*********************@bowser.marioworld...
On 2007-04-11, Rataplan <mi************@Levamisimplogic.itwrote:
>Hi
Why firefox and Opera puts, between the div <div id="menuHoriz"and the
following div "main", a horizontal space of 16px , only in this case ?

I don't want a space between "menuHoriz" and "main" div... and if set the
margin-top: -16px this result not a good workaround for IE 6.

What J?n Fairbairn said. Note that top margins can collapse against top
margins of descendent elements which can be a bit confusing. Use p {
margin-top: 0; }

Apr 12 '07 #5

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

Similar topics

6
by: Iain Bishop | last post by:
I'm trying to model objects for the following problem: A building site contains assemblies, each of which can contain other assemblies and/or materials. I have modelled this using a Site...
0
by: Flare | last post by:
Hi I tring to implement a model 2 architecture in a new test JSP site for my own training. I read this article...
34
by: yensao | last post by:
Hi, I have a hard time to understand difference and similarities between Relational database model and the Object-Oriented model. Can somebody help me with this? Thank you in advance. ...
10
by: Michael Strorm | last post by:
Hi! I've been having problems with a DTD. Having had the Sun XML validator reject a document, I put it through 'xmllint' for more information. 'Xmllint' noted a problem with the DTD itself;...
19
by: Steve Jorgensen | last post by:
I've run across this issue several times of late, and I've never come up with a satisfactory answer to the best way to handle this schema issue. You have a large section of schema in which a...
5
by: clintonG | last post by:
I'm looking for documentation and would not turn my nose up to any code from anybody who thinks they are good at the design of an algorythm that can be used to generated a hierarchical relational...
6
by: Robert W. | last post by:
I'm building my first major C# program and am try to use best practices everywhere. So I've implemented the "Document/View Model" whereby: - There's a Windows Form, which we'll call "formView" -...
1
by: Earl Teigrob | last post by:
Background: When I create a ASP.NET control (User or custom), it often requires security to be set for certain functionality with the control. For example, a news release user control that is...
122
by: Edward Diener No Spam | last post by:
The definition of a component model I use below is a class which allows properties, methods, and events in a structured way which can be recognized, usually through some form of introspection...
1
by: Alex Vinokur | last post by:
Hi, I have compilation problem on SUN CC compiler with template while using option -m64 (64-bit addressing model). No problem while using option -m32 (32-bit addressing model) $ CC -V CC:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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,...
0
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...
0
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,...

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.