473,748 Members | 2,670 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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=4 00px;
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 42495
day <Da*@theraces.i nvaliddomain> 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=4 00px;

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

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
15699
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 image (that contains smaller images) and I would like to assign the smaller images as hyperlinks. What is the best way to do this? I know I can use an imagemap, but is
5
3449
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 use <td background="img src=.."></td>, what is the correct method? Some modern templates do it all with CSS, but that is getting a bit too deep for my inexperience.
3
4978
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 the viewer adjusts the font-size on his browser? I have everything sized in em's, so that the actual <div> "box" resizes along with the text, but the background-image will not resize if the text is "zoomed". I can not find anything pertaining
2
4541
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 are hovered over I want them to be coloured in. I thought the easiest way to do this would be to change the background image of the entire map (since it's a bit of a pain trying to select each piece out of the image and
0
1540
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 image, thus creating a kind of fancy border. What would be the best practice to do that? I thought that if the containor box was relative and the contained boxes were absolute, that would work because the absolute boxes would be measured...
2
4549
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 image, thus creating a kind of fancy border. What would be the best practice to do that? I thought that if the containor box was relative and the contained boxes were absolute, that would work because the absolute boxes would be measured...
5
20155
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 "background-image". In some aspx files this background image are lost. for example: background-image:url('../App_Themes/images/image2.gif '); Any solution for this?
6
3454
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. If I place an <asp> label after the <body> tag, within one of the .NET containers, then it is easy to get the c# code to dynamically change the background image by placing suitable HTML on the label. The problem is that the background image does not...
16
4936
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 "background" or "background-image", the positioning only works with specifying pixels. If I specify the vertical position in pixels, the image gets cut-off at the bottom. I don't know what to do and would appreciate anyone's help. Specifically the code...
0
8995
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8832
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
9561
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
9332
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
9254
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...
0
8252
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
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.