GetDotted Domains

Viewing Thread:
"Strange CSS bug. Ideas?"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Mon 01/11/04 at 14:17
Regular
"Lisan al-Gaib"
Posts: 7,093
'k,

#header{
height: 120px;
width: 700px;
background-image: url(../i/lgo.jpg);
background-repeat: no-repeat;
background-position: left top;
background-color: #4B82CD;
margin: 0 0 0 1; /*ERROR*/
clear: both;
}

Noice "error" on the second bottom line for margin. Currently using this line, I have a holder gif (see zeldmans site for example) and a centered 700px area. The header sits quite happily in the center, and the gif lines forms the borders. The code above will not validate as I need a measurement after the 1 in #header.

Now, when I fix this by putting a "px" after, it'll validate. It'll also break the layout in firefox (ie fine) by moving the header 1pix to the right. Its a small thing, but it's driving me mental. Anyone any clues?

invalid.
holder -
header image *
border | (from gif image)

--------|*******************|------------

valid css. (1px to right -> )

--------| *******************------------
Mon 01/11/04 at 15:10
Regular
"Lisan al-Gaib"
Posts: 7,093
#header{
height: 120px;
width: 700px;
background: #4B82CD url(../i/lgo.jpg) no-repeat 0% 0%;
clear: both;
/* Ie, avant margin /*
margin: 0 0 0 1px;
}
html>body #header{
/* ff, Netscape, opera margin /*
margin: auto;
}

Works perfectly now in ie, opera, ff, netscape and avant. Class. Cheers Tyla.
Mon 01/11/04 at 15:04
Regular
"Lisan al-Gaib"
Posts: 7,093
Tyla wrote:
> try setting it to AUTO as the alignment is actual position is defined
> by the parent "wrapper". Without actually taking a full
> copy of the CSS and HTML, I'm making a bit of a guess here.

I'll give it a try. I'm a bit wary about posting my entire CSS as it's on compant time, and I'm sure they would be unhappy. Thanks for the info again.

> Where dot he GIF borders come in? And why can't you use CSS to define
> borders?

Look at zeldmans site. It's that gradiant bar that looks as it the centered content is slightly raised off the page. I figure if it's good enough for him, I can use the technique. :)
Mon 01/11/04 at 15:00
Regular
"l33t cs50r"
Posts: 2,956
try setting it to AUTO as the alignment is actual position is defined by the parent "wrapper". Without actually taking a full copy of the CSS and HTML, I'm making a bit of a guess here.

Where dot he GIF borders come in? And why can't you use CSS to define borders?
Mon 01/11/04 at 14:53
Regular
"Lisan al-Gaib"
Posts: 7,093
Tyla wrote:
> GIve us the source HTML for the element.






***************








Mon 01/11/04 at 14:51
Regular
"l33t cs50r"
Posts: 2,956
GIve us the source HTML for the element.
Mon 01/11/04 at 14:49
Regular
"Lisan al-Gaib"
Posts: 7,093
Tyla wrote:
> Do you have a URL?
>
> It will be FF redering it correctly, not IE, so the problem lies in
> the CSS not the browser.
>
> FWIW, Optimised it a little too:
>
> #header{
> width: 700px;
> margin: 0 0 0 1;
> clear: both;
> background: #4B82CD url(../i/lgo.jpg) no-repeat 0% 0%;
> height: 120px;
> }

Not at the moment as we need php / mysql support on the account.
Done a fix as mentioned above, and as to the optimisation, I always play to the "get the damn thing working first" rule, but thanks for the info. :) :) :)
Mon 01/11/04 at 14:47
Regular
"Lisan al-Gaib"
Posts: 7,093
Fixed.

#header{
height: 120px;
width: 700px;
background-image: url(../i/lgo.jpg);
background-repeat: no-repeat;
background-position: left top;
background-color: #4B82CD;
clear: both;
margin: 0 0 0 1px;
/* Ie, avant margin /*
}
html>body #header{
/* ff, Netscape, opera margin /*
margin: 0 1px 0 -0.5px;
}

It looks ugly, but it fixs the four areas that were affected. I'll be avoiding pixel precision in future.
Mon 01/11/04 at 14:46
Regular
"l33t cs50r"
Posts: 2,956
Do you have a URL?

It will be FF redering it correctly, not IE, so the problem lies in the CSS not the browser.

FWIW, Optimised it a little too:

#header{
width: 700px;
margin: 0 0 0 1;
clear: both;
background: #4B82CD url(../i/lgo.jpg) no-repeat 0% 0%;
height: 120px;
}
Mon 01/11/04 at 14:32
Regular
Posts: 10,364
Forgive me for not being much help and probably stating the obvious, but surely Firefox is parsing your CSS correctly and IE isn't.

Anyway, Tyla might know something about this, there's usually loads of annoying hacks you can use so that your site works in both browsers all right.

Edit: Or I could be completely wrong and missing the point of what you want. I don't know.
Mon 01/11/04 at 14:17
Regular
"Lisan al-Gaib"
Posts: 7,093
'k,

#header{
height: 120px;
width: 700px;
background-image: url(../i/lgo.jpg);
background-repeat: no-repeat;
background-position: left top;
background-color: #4B82CD;
margin: 0 0 0 1; /*ERROR*/
clear: both;
}

Noice "error" on the second bottom line for margin. Currently using this line, I have a holder gif (see zeldmans site for example) and a centered 700px area. The header sits quite happily in the center, and the gif lines forms the borders. The code above will not validate as I need a measurement after the 1 in #header.

Now, when I fix this by putting a "px" after, it'll validate. It'll also break the layout in firefox (ie fine) by moving the header 1pix to the right. Its a small thing, but it's driving me mental. Anyone any clues?

invalid.
holder -
header image *
border | (from gif image)

--------|*******************|------------

valid css. (1px to right -> )

--------| *******************------------

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Unrivalled services
Freeola has to be one of, if not the best, ISP around as the services they offer seem unrivalled.
Brilliant service.
Love it, love it, love it!
Christopher

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.