HighDots Forums  

Making a div part of the "background"?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Making a div part of the "background"? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
chardish@gmail.com
 
Posts: n/a

Default Making a div part of the "background"? - 10-15-2008 , 03:39 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

Reply With Quote
  #2  
Old   
Ben C
 
Posts: n/a

Default Re: Making a div part of the "background"? - 10-15-2008 , 05:56 PM






On 2008-10-15, chardish (AT) gmail (DOT) com <chardish (AT) gmail (DOT) com> wrote:
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


Reply With Quote
  #3  
Old   
chardish@gmail.com
 
Posts: n/a

Default Re: Making a div part of the "background"? - 10-16-2008 , 08:51 AM



On Oct 15, 5:56*pm, Ben C <spams... (AT) spam (DOT) eggs> wrote:
Quote:
Yes it is possible with some trickery. Here is an example:

http://www.tidraso.co.uk/misc/backgroundDiv.html
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


Reply With Quote
  #4  
Old   
Ben C
 
Posts: n/a

Default Re: Making a div part of the "background"? - 10-16-2008 , 09:32 AM



On 2008-10-16, chardish (AT) gmail (DOT) com <chardish (AT) gmail (DOT) com> wrote:
Quote:
On Oct 15, 5:56*pm, Ben C <spams... (AT) spam (DOT) eggs> wrote:
Yes it is possible with some trickery. Here is an example:

http://www.tidraso.co.uk/misc/backgroundDiv.html

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


Reply With Quote
  #5  
Old   
mobleyreporting@gmail.com
 
Posts: n/a

Default Re: Making a div part of the "background"? - 10-16-2008 , 10:36 AM



On Oct 16, 9:32*am, Ben C <spams... (AT) spam (DOT) eggs> wrote:
Quote:
Of course:

http://www.tidraso.co.uk/misc/backgroundDiv2.html
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


Reply With Quote
  #6  
Old   
mobleyreporting@gmail.com
 
Posts: n/a

Default Re: Making a div part of the "background"? - 10-16-2008 , 02:04 PM




Quote:
On Oct 16, 9:32*am, Ben C <spams... (AT) spam (DOT) eggs> wrote:

Of course:

http://www.tidraso.co.uk/misc/backgroundDiv2.html
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.


Reply With Quote
  #7  
Old   
Ben C
 
Posts: n/a

Default Re: Making a div part of the "background"? - 10-16-2008 , 02:13 PM



On 2008-10-16, mobleyreporting (AT) gmail (DOT) com <mobleyreporting (AT) gmail (DOT) com> wrote:
Quote:
On Oct 16, 9:32*am, Ben C <spams... (AT) spam (DOT) eggs> wrote:

Of course:

http://www.tidraso.co.uk/misc/backgroundDiv2.html

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.


Reply With Quote
  #8  
Old   
chardish@gmail.com
 
Posts: n/a

Default Re: Making a div part of the "background"? - 10-16-2008 , 04:51 PM



On Oct 16, 2:13*pm, Ben C <spams... (AT) spam (DOT) eggs> wrote:
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.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.