Fixed Background

E

e n | c k m a

On sites like:

<URL:http://www.w3.org/TR/xhtml2/mod-object.html#sec_14.1>

There's a fixed text to the left that says "W3C Working Draft". Sorry if
this has been covered before but I am curious as to how they made it fixed.

Looking at the CSS code, all they used was:

body
{
background: url(...);
}

of course, with the "..." replaced with the location of the image. As far
as I know using something like position: fixed doesn't work in IE [is that
true?]. If that is true, how did they do this?? It's so smooth!

Nick.
 
O

Owen Jacobson

e said:
of course, with the "..." replaced with the location of the image.
As far as I know using something like position: fixed doesn't work in
IE [is that true?]. If that is true, how did they do this?? It's so
smooth!

'fixed' in general doesn't work under IE, with one exception:
background-attachment: fixed; works fine for the body element only.

Owen
 
E

e n | c k m a

'fixed' in general doesn't work under IE, with one exception:
background-attachment: fixed; works fine for the body element only.

Ah okay, thanks for clarifying. Still, they didn't specify that either.

They also didn't even specify no repeats or anything either but it doesn't
repeat!
The only code they used [that I could find] was literally:

body
{
background: url(...);
}

they didn't mention nox-repeat or noy-repeat [or whatever the properties
are] but it just sits there, top left corner without repeating! And it's
fixed scrolling!

Nick.
 
N

Nico Schuyt

e said:
They also didn't even specify no repeats or anything either but it
doesn't repeat!
The only code they used [that I could find] was literally:

body
{
background: url(...);
}

they didn't mention nox-repeat or noy-repeat [or whatever the
properties are] but it just sits there, top left corner without
repeating! And it's fixed scrolling!

In http://www.w3.org/StyleSheets/TR/W3C-WD.css :
body {
padding: 2em 1em 2em 70px;
margin: 0;
font-family: sans-serif;
color: black;
background: white;
background-position: top left;
background-attachment: fixed;
background-repeat: no-repeat;}

Nico
 
E

e n | c k m a

In http://www.w3.org/StyleSheets/TR/W3C-WD.css :
body {
padding: 2em 1em 2em 70px;
margin: 0;
font-family: sans-serif;
color: black;
background: white;
background-position: top left;
background-attachment: fixed;
background-repeat: no-repeat;}

Nico

Crap. All I saw was the body declaration at the bottom. Why the hell do
they have two body declarations?? Ah nevermind.
 
T

Toby A Inkster

e said:
Crap. All I saw was the body declaration at the bottom. Why the hell do
they have two body declarations??

The one that sets background-position, etc is reused by every recent
recommendation/draft. The one that defines the URL for the image has to be
different for each draft.
 
D

Disco

e said:
hmm... that still doesn't make much sense when you think about it...
what's the difference between changing the background-image url of the
second body declaration and changing the background-image url of the
first body declaration?

Unless I've completely misunderstood what you were saying.

It looks like the css file has been built dynamically, and the second body
rewference has been appended to the header that contains the first body
reference that is use elsewhere.

And if that is the case, I think it is not such a bad way of doing it. It
would not be much different than placing the image reference in the html
document itself.
 

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,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top