Making a div part of the "background"? 
October 15th, 2008, 08:45 PM
| | | |
Hello,
Is it possible to make a div part of the "background"? In other words,
I want it to always render if that part of the screen is showing, but
not create scrollbars under any circumstances. Furthermore, I want it
to obey the same positioning rules as a normal div. And (like a
background image) I don't want the presence of this div to shift other
elements over.
Cheers,
Evan | 
October 15th, 2008, 11:05 PM
| | | | re: Making a div part of the "background"?
On 2008-10-15, chardish@gmail.com <chardish@gmail.comwrote: Quote:
Hello,
>
Is it possible to make a div part of the "background"? In other words,
I want it to always render if that part of the screen is showing, but
not create scrollbars under any circumstances. Furthermore, I want it
to obey the same positioning rules as a normal div. And (like a
background image) I don't want the presence of this div to shift other
elements over.
| Yes it is possible with some trickery. Here is an example: http://www.tidraso.co.uk/misc/backgroundDiv.html | 
October 16th, 2008, 01:55 PM
| | | | re: Making a div part of the "background"?
On Oct 15, 5:56*pm, Ben C <spams...@spam.eggswrote: This is a great start! One issue, though: the box stays fixed to the
page when you scroll (at least, on FF3/win). This seems odd, even for
an absolutely-positioned div (as opposed to a fixed-position one.) Any
way to change this and make it scroll when the page scrolls?
Cheers,
Evan | 
October 16th, 2008, 02:35 PM
| | | | re: Making a div part of the "background"?
On 2008-10-16, chardish@gmail.com <chardish@gmail.comwrote: Quote:
On Oct 15, 5:56*pm, Ben C <spams...@spam.eggswrote:>
This is a great start! One issue, though: the box stays fixed to the
page when you scroll (at least, on FF3/win). This seems odd, even for
an absolutely-positioned div (as opposed to a fixed-position one.)
| Everything is not what it appears-- you're scrolling #main, not the
viewport.
So you get the effect of background-attachment: fixed which I didn't
know wasn't what you wanted. The background div doesn't scroll because
it's not inside #main. Quote: |
Any way to change this and make it scroll when the page scrolls?
| Of course: http://www.tidraso.co.uk/misc/backgroundDiv2.html | 
October 16th, 2008, 03:45 PM
| | | | re: Making a div part of the "background"?
On Oct 16, 9:32*am, Ben C <spams...@spam.eggswrote: Beautiful! I'll have to point you to the final design when it's
public. I'm really, really excited about how smooth this is. Thanks!
Cheers,
Evan | 
October 16th, 2008, 07:05 PM
| | | | re: Making a div part of the "background"? Quote:
On Oct 16, 9:32*am, Ben C <spams...@spam.eggswrote:
>> | Hrm. This doesn't work in IE6 (surprise) and renders two scrollbars in
IE7 (that's a new one on me.) Works fine in Firefox 3, Opera 9,
Chrome, Safari 2.
I might just have to bite the bullet and load a separate stylesheet
for IE users. Sad. | 
October 16th, 2008, 07:15 PM
| | | | re: Making a div part of the "background"?
On 2008-10-16, mobleyreporting@gmail.com <mobleyreporting@gmail.comwrote: Quote:
> Quote:
>On Oct 16, 9:32*am, Ben C <spams...@spam.eggswrote:
>>>> | >
Hrm. This doesn't work in IE6 (surprise) and renders two scrollbars in
IE7 (that's a new one on me.) Works fine in Firefox 3, Opera 9,
Chrome, Safari 2.
| I can't help you there. I only know CSS. Quote:
I might just have to bite the bullet and load a separate stylesheet
for IE users. Sad.
| Well it's time they woke up and smelt the coffee. | 
October 16th, 2008, 09:55 PM
| | | | re: Making a div part of the "background"?
On Oct 16, 2:13*pm, Ben C <spams...@spam.eggswrote: Quote: |
Well it's time they woke up and smelt the coffee.
| Got it working using a separate stylesheet and some ugly hacks. The
new CSS doesn't validate, but since it's only loaded if the user is
running IE, who cares? Besides, my XHTML is still valid. |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 225,662 network members.
|