4 replies [Last post]
craigtaylor74
craigtaylor74's picture
Offline
Regular
Barcelona
Last seen: 15 years 37 weeks ago
Barcelona
Timezone: GMT+1
Joined: 2004-02-04
Posts: 31
Points: 0

and for my next question...
can anyone tell me why this code lays out fine in ie (for once) while in mozilla and opera it seems like the #buttons and the #date divs cannot co-exist on the same line (or something like that).
here is the code for the two divs (the whole thing is attached if anyone feels like looking or better still have a look at www.glasgowapartment.co.uk to see what i mean)

#buttons{
position: absolute; bottom:0px; left: 10px;
font: bold 16px Arial, sans-serif; background: transparent; color: #665531;
}
#buttons a:link, #buttons a:visited{
background:#F9F7F2; color: #665531;
text-decoration: none;
}

#buttons a:hover{
background:#F9F7F2; color:#F97c00;
}
#date {
position: absolute; bottom: 0px; right: 10px;
font: bold 16px Arial, sans-serif; background:#F9F7F2; color: #665531;
}

Thanks very much,
Craig.

http//www.ctam.co.uk

Daybreak_0
Offline
Enthusiast
Sydney, Australia
Last seen: 15 years 48 weeks ago
Sydney, Australia
Timezone: GMT+10
Joined: 2003-11-15
Posts: 389
Points: 0

2 divs on same line?

I think this may be your problem.
With the buttons div you have a <p> tag, which of course has a bottom margin!

Give it its own class, with margin: 0px;

Regards
Day

The only way to learn is to do it yourself

craigtaylor74
craigtaylor74's picture
Offline
Regular
Barcelona
Last seen: 15 years 37 weeks ago
Barcelona
Timezone: GMT+1
Joined: 2004-02-04
Posts: 31
Points: 0

2 divs on same line?

thanks very much ... there seem to be so many "of course`s" in css.
I hope you don`t mind if I ask a follow up question ... why does my 15px margin on the div above buttons look so different in Opera vs ie and Mozilla?
Ta,
Craig.

http//www.ctam.co.uk

Daybreak_0
Offline
Enthusiast
Sydney, Australia
Last seen: 15 years 48 weeks ago
Sydney, Australia
Timezone: GMT+10
Joined: 2003-11-15
Posts: 389
Points: 0

2 divs on same line?

hmmm not sure why, but it may be some bug or definition view of the standards.

It is nearly impossible to get a page looking perfect in every browser and the time you take to do so, is normally not worth it.

As you have the two most popular browsers working well, and Opera is still fine even though slightly different, Leave well enough alone Wink

Regards
Day

The only way to learn is to do it yourself

timhobbs
timhobbs's picture
Offline
Regular
Monterey, CA
Last seen: 15 years 51 weeks ago
Monterey, CA
Timezone: GMT-8
Joined: 2003-10-27
Posts: 37
Points: 0

2 divs on same line?

It is likely due to the <p> tags. It seems each browser adds margin/padding differently to <p>'s. Since each is different, I usually set the default margin/padding to zero, then style specific <p>'s when necessary. You could also set the default to a specific value, that way your pages should look consistant.

Good luck!