473,396 Members | 1,916 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,396 software developers and data experts.

Background image, within a div, in FF

day
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;
background-image:url(bgrd-foo.jpg);
background-position: center top;
background-repeat:no-repeat;
background-attachment: fixed;">

Looks great in IE. But in FF, the background-position: center top
part causes the image to be positioned at the top of the PAGE rather
than the top of the DIV, and worse, the image only displays starting
where the div occurs on the page. By that, I mean the top portion of
the image doesn't show up - only the portion of the image that is to
be within the div shows up.

How can I cause the image to be positioned at the top of the div in at
least IE and FF?

How can I cause the div to be sized high enough to hold the whole
image in both browsers? In FF, the image truncates at the bottom of
the div.

Jul 21 '05 #1
2 42470
day <Da*@theraces.invaliddomain> wrote:
Looks great in IE.
IE is wrong.
But in FF, the background-position: center top
part causes the image to be positioned at the top of the PAGE rather
than the top of the DIV


As it should, quote from
http://www.w3.org/TR/CSS21/colors.ht...round-position
"If the background image is fixed within the viewport (see the
'background-attachment' property), the image is placed relative to the
viewport instead of the element's padding area."

--
Spartanicus
Jul 21 '05 #2
day wrote:
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;

--------------------^

Typo I hope.

[...]
--
Rob
Jul 21 '05 #3

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

Similar topics

10
by: Imran | last post by:
Hi, I am attempting to create a CSS-driven website, in that I want to be able to control the display/content from the CSS file. I do not want to use tables. On a page, I have a background...
5
by: Doug Laidlaw | last post by:
HTML validators say that "background" is not a valid attribute for a <td> tag I want to set an image as the background for one cell only, and to have the cell content on top of it. If I can't...
3
by: Greg Heilers | last post by:
Hello everyone... If one has a <div> that is completely filled with a background-image; how does one style it so that the image *continues* to fill the <div> top-to-bottom, left-to-right; if...
2
by: chris_culley | last post by:
Hi there, I've got a gif with (highly) irregular shapes (lots of jigsaw pieces) that I want to map so that each piece is a link... The pieces are currently just a frame drawing, but as they...
0
by: Skeeve | last post by:
Hi there, I'm trying to create a containing box (relative position), and within it, I'm trying to line that box with four (top, right, left, bottom) thin boxes that contain a repeated background...
2
by: Skeeve | last post by:
Hi there, I'm trying to create a containing box (relative position), and within it, I'm trying to line that box with four (top, right, left, bottom) thin boxes that contain a repeated background...
5
by: 3Dfelix | last post by:
I have a problem when using a Master page file in diferent aspx files. Some of this aspx are in different places. I have see that the problem is with styles definition on master file, when use...
6
by: ChrisAtWokingham | last post by:
I am creating a website using .Net v2.0 and c# and I have a problem with background images. I want to dynamically change the background image on the page, depending on data in the SQL database. ...
16
by: stevedude | last post by:
CSS newbie again. I have a problem trying to get coffee mug images within anchor tags to center with my link text for a vertical list menu. If I use the horizontal/vertical properties of...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...

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.