CSS: problem with background attachment

D

Dimorph

By standard, background attachment goes in this order: horisontal position,
vertical position. Unfortunantly, Opera does it the other way. So when i
put:
background: url(title.jpg) no-repeat center 32px;

IE puts it on top of the page, and Opera puts it on the left side of the
page.

Any suggestions?
 
G

GD

Dimorph said:
By standard, background attachment goes in this order: horisontal position,
vertical position. Unfortunantly, Opera does it the other way.

No it doesn't.
background: url(title.jpg) no-repeat center 32px;

This is invalid CSS at the moment. The CSS spec says you cannot mix
numeric values and keywords so change it to '50% 32px'

As far as I know, this will be changed in the future at which point you
can expect Opera's behaviour to follow, but the CSS1 and CSS2 specs do
not allow it.
 
S

Steve Pugh

Dimorph said:
By standard, background attachment goes in this order: horisontal position,
vertical position.

No it doesn't. Background-attachment takes a single value out of
scroll, fixed and inherit. You're thinking of background-position.
Unfortunantly, Opera does it the other way.

Not true.
So when i put:
background: url(title.jpg) no-repeat center 32px;

My copy of Opera (7.23 on WinXp) completely ignores the whole of the
that background property, because of the syntax errors in the CSS.

http://www.w3.org/TR/CSS2/colors.html#propdef-background-attachment

"Keywords cannot be combined with percentage values or length values."

You want 50% 32px
IE puts it on top of the page, and Opera puts it on the left side of the
page.

IE is more forgiving of bad syntax than Opera.

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top