473,659 Members | 2,980 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.in fo/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 4460
RamananKalirajan
608 Contributor
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
2745
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
9658
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 size was changed. How can I make the scrolling content "stick" the position with respect to the scrollowing box? Your advise is appreciated. Spencer
20
7907
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 mouseup event outside the document? Also, how can I get the relative coordinates of the cursor while it is outside the browser? Thank you.
4
6895
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 <td>, but I don't see how to have the image shrink. Without JavaScript, the standard seems to be scrollbars when the browser shrinks. I'd like the picture to shrink in size and avoid the scrollbars.
33
4063
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 reserve word "_blank" opens a blank new browser window for every link, which can sometimes result in a lot of open browser windows. Is there no way to "reuse" a previously linked browser window and have it load the new web page in Foreground
8
1851
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 image would be in the main window and would have a button that when pressed brings up the "popup" window that has the high-res image. I would like the window to be re-used instead of creating yet another popup window if the user navigates to another...
4
5079
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 to be centered. However, after I center it, the html images move when the browser is resized. My text is sticking to it's coordinates. How do I get the images to stay where they are, as well. Any help is much appreciated. Thank you,
2
5302
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 the browser window. I'm not sure what I've done wrong but I'll post the CSS if you wouldn't mind taking a look at it please. You'll see in the .floatlink the image I am trying to use. I'd post this on the web for you guys but the server and host...
18
2599
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 link: www.ibtestsite.info I've colored the background black and added a background image which is the
0
1964
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 the content, my background div's and their images start to decrease horizontally. I think it has something to do with my #main div as well as my #wrap div's. They are the ones decreasing horizontally and eliminating everything in their path...
0
8428
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
8747
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8528
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
8627
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
6179
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
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
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...
2
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
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.