473,378 Members | 1,346 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Background Image Fixed Position Question

I'm missing something regarding positioning background images. It's probably
obvious, and I hope someone here will note it for me. I'm trying to do
something like the complex spiral thing, only much simpler. According to the
O'Reilly CSS definitive guide book, it should work, but it isn't. On
http://www.xmission.com/~wake/backgroundtest.html I have a background image
showing through, but not showing up in the header areas. It is my impression
that it should be showing through even there, and then as I'd scroll only the
part that should be underneath those headers would show. (My header tag is: h1,
h3 { background-image: url(wakedryerfaded.jpg); background-repeat: no-repeat;
background-position: center; background-attachment: fixed; }.) Not happening,
obviously. Why?
Feb 10 '07 #1
7 4938
Paul Wake wrote:
I'm missing something regarding positioning background images. It's probably
obvious, and I hope someone here will note it for me. I'm trying to do
something like the complex spiral thing, only much simpler. According to the
O'Reilly CSS definitive guide book, it should work, but it isn't. On
http://www.xmission.com/~wake/backgroundtest.html I have a background image
showing through, but not showing up in the header areas. It is my impression
that it should be showing through even there, and then as I'd scroll only the
part that should be underneath those headers would show. (My header tag is: h1,
h3 { background-image: url(wakedryerfaded.jpg); background-repeat: no-repeat;
background-position: center; background-attachment: fixed; }.) Not happening,
obviously. Why?

Validate your css
http://jigsaw.w3.org/css-validator/
Feb 10 '07 #2
>Validate your css

Excellent idea, as it led to an incorrect left bracket. Now I just need to
rework the image itself.
Feb 11 '07 #3
http://www.xmission.com/~wake/backgroundtest.html validates now, but I'm still
confused about one thing. Although the CSS puts the header and body text in
front of the background graphic, it doesn't put the color behind the header in
front of the graphic.
http://meyerweb.com/eric/css/edge/co...al/glassy.html and
http://www.brooks-craig.com/ do. What's up with that?
Feb 11 '07 #4
Paul Wake wrote:
http://www.xmission.com/~wake/backgroundtest.html validates now, but I'm still
confused about one thing. Although the CSS puts the header and body text in
front of the background graphic, it doesn't put the color behind the header in
front of the graphic.
http://meyerweb.com/eric/css/edge/co...al/glassy.html and
http://www.brooks-craig.com/ do. What's up with that?
Well, look at the glassy example you provided. Take away the
glassy-tan.jpg background-image Eric specifies for h2, and the
background-color for that element (#CBB196) also shows, "in front" of
the body's glassy-bg.jpg background-image. In this case, your site is
equivalent to that of Eric Meyer. (Congratulations!)

If you want a different effect on your site, you need to provide a
different background image for your h1 and or h3 elements, like Eric did.

Starting from apparent front to back, we have (over-simplified):
- text of the child element
- bg-image of the child element
- bg-color of the child element
- bg-image of the parent element
- bg-color of the parent element

where the nesting can continue (if we start with a grandchild element)
sort of recursively and, again, where I've way oversimplified the rules.
At each level, what we can see conceals the stuff at the lower levels.

Play with it and see for yourself. HTH.

--
John
Feb 11 '07 #5
Paul Wake wrote:
http://meyerweb.com/eric/css/edge/co...al/glassy.html and
I can't wait till we can do that with css.
http://www.brooks-craig.com/ do. What's up with that?

This one is easy. Use opacity - though it's not supported in all browsers.
Feb 11 '07 #6
OK, thanks! I got http://www.xmission.com/~wake/backgroundtest.html to work in
Firefox, although in IE it's skeewhompus. Probably has something to do with a
banner that displays up top in IE but not in Firefox, although that seems odd: I
thought the fixed background image is supposed to stay centered relative to the
viewport, and so it seems like it shouldn't matter whether the headers are
higher or lower on the screen (relative to where they'd display in another
browser), because the part of the centered image that's behind them should just
show through. I feel awfully dense.
Feb 11 '07 #7
Paul Wake wrote:
>
I
thought the fixed background image is supposed to stay centered relative to the
viewport
It is, and does in a conforming browser. IE6 is non-conforming - big
surprise. I don't know if IE7 is any better.

--
Berg
Feb 11 '07 #8

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

Similar topics

2
by: Markus Mohr | last post by:
Hi, everyone, I have a special problem: For every monitor resolution in 200 pixel steps from 800 to 1600 pixels I have an image to be shown as centered background-image. Those images all...
1
by: Theodore A. Jencks | last post by:
Hi all, I posted a question about a side navigation bar earlier where I was encountering this problem. I thought I'd repost the question in a more general format because I'm not sure people...
6
by: Michael Rozdoba | last post by:
I've had some trouble getting IE to behave in respect of applying absolute positioning to a span on an a:hover. I can get it to work, but I don't understand why certain code causes it to fail to...
2
by: day | last post by:
I'm trying to use a non-scrolling background image within a div (the non-scrolling part is a "nice-to-have" vs a "have to have"). The style for that is: <div style="height=400px;...
3
by: Sridhar | last post by:
Hi, I have created a user control which has the html code as follows <TABLE id="ToolBarTable" cellSpacing="0" cellPadding="0" width="100%" border="0"> <tr> <td align="right"...
1
by: Philipp Kraus | last post by:
Hi, I have one problem with my position of my background image. I have created one div-tag that has a background image, which should be fixed during scrolling. On the left side of the div is my...
4
by: Philipp Kraus | last post by:
Hi, I have one problem with my position of my background image. I have created one div-tag that has a background image, which should be fixed during scrolling. On the left side of the div is my...
10
by: VividWeb | last post by:
Hi. I am relatively new to CSS and HTML but have a basic understanding of most things. One of my backgrounds is not positioning correctly in IE 7 or AOL. The background behind the content...
0
by: ton | last post by:
Hi, I have an Image which is dark grey/black, at the top a white line, at the left site a white line as well. At 192 px from the left of the screen I position a DIV with this image as the...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.