473,324 Members | 2,196 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,324 software developers and data experts.

Background positioning: background image moves when browser window is resized

The website I am working on looks fine so long as the browser window is as wide or wider than the width of the background image. But as soon as I re-size the browser window down to the point where it becomes narrower than the background image, the latter moves to the left and eventually out of the screen, while the rest of the tables and images remain lined up and stop moving once the left-hand edge reaches the edge of the screen.

The aforementioned background image is set to center (see code below).

How do I prevent the background image from moving out of alignment?

Site:
http://www.tomsunic.info/contact.html

Expand|Select|Wrap|Line Numbers
  1.  
  2. }
  3. body {
  4.     background-color: #666666;
  5.     background-image: url(background.jpg);
  6.     background-position: center;
  7.     background-repeat: no-repeat;
  8.     margin-top: 0px;
  9. }
  10.  
  11.  
Oct 5 '10 #1
2 4430
RamananKalirajan
608 512MB
Hi,
I looked into your website. The problem is like you have fixed the table height and width. But the body has floating property. Try to fix the height and width of the body and enable scrollbar if the resolution is changed. Its not the problem with the background property.

Thanks and Regards
Ramanan Kalirajan
Oct 6 '10 #2
Hi Ramanan,

Thank you for your reply. Unfortunately, I am not sure how to do that. What line of code do I need to insert and where?

Thank you!
Oct 6 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: olimoli | last post by:
Hi, I'm looking for a javascript that lets me drag an image from one browser window to another. Is there a solution for this problem? Cheers Olaf
3
by: spencer | last post by:
Hello, I have an index page with an autoscroller writen with CSS. The problem is the scrolling content(text and inages)'s position is correct but will off position when the broswer(IE) window...
20
by: Mandy Memphis | last post by:
If I perform a mousedown within a document, move the mouse outside the browser window, and then release the mouse button, the document.onmouseup event does not fire. Is there any way to detect a...
4
by: Bob Richardson | last post by:
Is it possible for an image to SHRINK (both height and width, keeping same h/w ratio) when the browser's width is reduced? It's easy to have both h & w increase, as needed, to fill up 100% of the...
33
by: randau | last post by:
Linking to a Targeted Browser Window I'd like to open reference links to other web sites in a separate browser window from the browser window hosting my own web site pages. The Link Target...
8
by: David W. Simmonds | last post by:
Is there an easy way to create a new browser window from C# and ASP.NET? I would just like to have a popup window without any menus or toolbars that would contain a high-res image. The low-res...
4
by: Anna97 | last post by:
Hi, I guess I've built my site sort of strangely: The images are in the html (using tables), but the text is all in css positioned using coordinates (hovering over the images). I need my page...
2
by: natedemontigny | last post by:
Ok guys, I'm still new at all this but I recently did a site and was able to amke the contact button stay in place. I copied the code and used it in a new site and now it moves around when I resize...
18
by: LayneMitch | last post by:
Hello. After getting great advice on positioning, I've edited my code and it's looking more stable. Now I need a little assistance with background image placement. Please click on this...
0
gauchomatt
by: gauchomatt | last post by:
I have a liquid site which expands perfectly when the browser window is larger than the actual content. However, when I decrease the browser window size to a point that it's smaller horizontally than...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.