5 replies [Last post]
mol
Offline
Regular
out of this world
Last seen: 13 years 1 day ago
out of this world
Joined: 2007-08-23
Posts: 20
Points: 0

Hi all,

Using h1 rather than div make the header box down in FF (IE is OK).If I change it to div, it back to normal.

Here is the code,
CSS :

body{
margin:0;
}
h1{
font-family:Geneva, Arial, Helvetica, sans-serif;
color:white;
}
#cont{
margin:0px;
margin:0 auto;
}
#header{
height:180px;
background-color:#0099CC;
}
#header2{
width:773px;
height:180px;
margin:0 auto;
}
#content{
margin:0 auto;
width:773px;
height:450px;
padding:12px 0 0 12px;
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size:13px;
color:#666666;
}

HTML:

The next step is to decide which divs should be liquid. Let's say you want the Content div to expand and contract, but you want to keep the left and right sidebars at a fixed width, say 200 pixels for the Nav div and 150 pixels for the Links div. The Content div needs to be liquid, clearly, but what about the Logo div? If you were building this layout as a table, you wouldn't necessarily have to specify the width of the top cell as 100%

thanx

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 25 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

You need really to explain

You need really to explain the problem a little more clearly, but from the looks of things you aren't controlling the margins on the header or there's a collapsing margin at work.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

mol
Offline
Regular
out of this world
Last seen: 13 years 1 day ago
out of this world
Joined: 2007-08-23
Posts: 20
Points: 0

Hi Hugo, Sory my english

Hi Hugo,

Sory my english not good enough but I'll try to explain it again,

you see : Header it cause my header (blue header) shift down (in FF),
but if I change h1 with div become :

Header
the header back to position it should.

So, what can I do to fix it at the same time I still use h1 not div.

thanx

thepineapplehead
thepineapplehead's picture
Offline
Moderator
Last seen: 10 weeks 2 days ago
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9683
Points: 819

Margins

h1 {margin: 0;}

Verschwindende wrote:
  • CSS doesn't make pies

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 25 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

As TPH points out control

As TPH points out control the margins on the h1; you have controlled margins on the divs but not the h1.

Sorry realise that English is not everyone's first language but we do need as much detail as possible.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

mol
Offline
Regular
out of this world
Last seen: 13 years 1 day ago
out of this world
Joined: 2007-08-23
Posts: 20
Points: 0

to thepineapplehead &

to thepineapplehead & Hugo,

great, it works

many thanx