473,765 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Making a div part of the "background "?

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
Oct 15 '08 #1
7 2231
On 2008-10-15, ch******@gmail. com <ch******@gmail .comwrote:
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
Oct 15 '08 #2
On Oct 15, 5:56*pm, Ben C <spams...@spam. eggswrote:
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
Oct 16 '08 #3
On 2008-10-16, ch******@gmail. com <ch******@gmail .comwrote:
On Oct 15, 5:56*pm, Ben C <spams...@spam. eggswrote:
>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.
Any way to change this and make it scroll when the page scrolls?
Of course:

http://www.tidraso.co.uk/misc/backgroundDiv2.html
Oct 16 '08 #4
On Oct 16, 9:32*am, Ben C <spams...@spam. eggswrote:
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
Oct 16 '08 #5
On Oct 16, 9:32*am, Ben C <spams...@spam. eggswrote:
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.
Oct 16 '08 #6
On 2008-10-16, mo************* @gmail.com <mo************ *@gmail.comwrot e:
>
>On Oct 16, 9:32*am, Ben C <spams...@spam. eggswrote:
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.
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.
Oct 16 '08 #7
On Oct 16, 2:13*pm, Ben C <spams...@spam. eggswrote:
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.
Oct 16 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
7264
by: Torbjørn Pettersen | last post by:
I've got a table where I want some of the cells to use a background image. The cells have variable height, so I am using an image with a rather small height to fill up the background of the cells, thus making I look like one high image in there. When validating it, I get this error: there is no attribute "BACKGROUND" The validators also tell me there are no "HEIGHT" or
4
461
by: Charles Law | last post by:
When displaying the Color Picker for a web page (in the VS IDE), Background is listed on the System Colors tab. Also, Color.FromName("Background").IsNamedColor returns True. However, Background is not a member of the SystemColors class, and it is not
2
2522
by: Just D. | last post by:
Who knows what should we include into aspx file to show some image as a background picture but only once at the top of the page? I don't want to add the Image control because even if it uses a transparent gif image I can't use LinkButtons over this image. The string that I'm using now is: <body background="BMP/Header.gif" MS_POSITIONING="GridLayout"> Maybe I should use something else in place of GridLayout?
8
2229
by: Maxwell2006 | last post by:
Hi, Using ASP.NET 2.0, I have this tag in my asp page: <td runat =server background="~/Images/Header2.gif">&nbsp;</td> The problem is when I run the page, the server side TD tag renders in this format in html output:
2
2207
by: soulmach | last post by:
Hello forum friends. I performed a search on this topic, but I couldn't find anything useful. I wasn't really sure what to search. First I'll state what I am trying to do. I recently agreed to make a site for a friend. It's good practice for me. The site will have (among other things) a biography. I told him to look at Zen Garden and find some layouts, and I'd see what I can do. His favorite layout for Biography is: ...
1
3884
by: Miggiddy79 | last post by:
Does any body know how to fix this. I am trying to validate these html codes through the markup validation. I have 5 error messages: 1) Line 114, Column 15: there is no attribute "BACKGROUND" . <td background="images/nav1bg.gif" onMouseOver="this.className='over'" onMouseOu 2) Line 223, Column 74: there is no attribute "BACKGROUND" .
0
9399
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9957
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.