473,516 Members | 2,865 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Body with a background image doesn't center in IE7

Hi all. First of all, sorry for my English and thank you in advance to any of you that can help. I'm developing a website for a non-profit organization (http://www.provecms.com/ajg/ still not finished). I'm basically modifying a version of the Twenty Ten Wordpress theme. My body tag has a background image (quite a big image, 1800-something pixels wide, a reflexion of the header) that should be centered with background:center; it works in all browsers, but in IE 7 it's moved to the right. It looks like in different resolutions it's moved more or less; what can I do? Thank you very much. Two screenshots at different resolutions: http://www.provecms.com/ajg/wrong_ie7.JPG and http://www.provecms.com/ajg/wrong_ie7_big.JPG
Sep 29 '10 #1
6 4577
RamananKalirajan
608 Contributor
can you post the css class for that div.

Thanks and Regards
Ramanan Kalirajan
Sep 30 '10 #2
Hi Ramanan, do you mean the css of the body tag? I used it to set a centered background image, not a div.
That would be

Expand|Select|Wrap|Line Numbers
  1. body {
  2. background:url("http://bytes.com/images/basso.jpg") no-repeat scroll center 270px #6C9BE0;
  3. width:100%;
  4. font-size:82%;
  5. line-height:18px;
  6. }
Thank you
Sep 30 '10 #3
I found out that, apparently, IE7 didn't like my body tag to have a BG image (couldn't center it at all).
I created a wrapping div, gave it the very same CSS, and now it works. If somebody ever has the same problem, I hope he/she reads this thread :)
Oct 1 '10 #4
Try with
Expand|Select|Wrap|Line Numbers
  1. text-align:center;
However it might ruin your text positionioning in all of the website so you'll have position it extra 4 every element.
You might want to add and an IF IE7 statement
Oct 1 '10 #5
kidwon
4 New Member
Hi Fil
Try with IE7 if statement and
Expand|Select|Wrap|Line Numbers
  1. text-align:center;
I've met a problem with centering image in ie7 and that help me
You might need to specify additionally the text alignment for the rest of the elements but if that solves the problem....
Also why don't you register thus you won't need moderation and approval after posting
Oct 1 '10 #6
RamananKalirajan
608 Contributor
In the CSS,
Expand|Select|Wrap|Line Numbers
  1. background:url("http://bytes.com/images/basso.jpg") no-repeat scroll center 270px #6C9BE0;
can I know why you have given 270px, instead of that you can try with center.
Ex:
Expand|Select|Wrap|Line Numbers
  1. background:url("http://bytes.com/images/basso.jpg") no-repeat scroll center 270px #6C9BE0;
Specifying the pixel may change the alignment/orientation in different resolution.

Thanks and Regards
Ramanan Kalirajan
Oct 4 '10 #7

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

Similar topics

1
1284
by: Yves Lavoie | last post by:
Hi, In my web C# project, I'm able to put an image in background to my aspx window but I it is in mosaique mode, I would like it in center mode. Do you have an idea how to do this??? Thanks Yves Lavoie
4
3036
by: lindsey.crocker | last post by:
I have this links list with background images set on them which changes when they roll over. The <td> is set valign="middle" however as soon as you apply the rollover to the link, the text jumps to the top of the <td> instead of staying middle. I can not put padding on the top as some links are 2 lines and some are 1 line.
4
1852
by: ruca | last post by:
How can I set body background with an image, but centered and not tiled? When I put background="image1", it fills my page with the image many times. I only want to put at the beggining and centered. I don't won't to use <img src="image1"> because I have a choice menu that I want over the image. -- Thank's (if you try to help me)
2
2516
by: Just D. | last post by:
Who knows what should we include into aspx file to show some image as a background picture but only once at the top of the page? I don't want to add the Image control because even if it uses a transparent gif image I can't use LinkButtons over this image. The string that I'm using now is: <body background="BMP/Header.gif"...
3
27193
by: KNDesign | last post by:
I've set a background image to repeat-y and at 100% height. It appears fine when I open the window, but when I resize to a smaller height so that I must scroll down to see the rest, the background image is suddenly gone from the bottom. #background { position: absolute; top: 0px; bottom: 0px; left: 50%;
1
3473
by: can2564 | last post by:
Hello, I have an image as a background in the style sheet. The image is big and I would like to make it smaller. Can I do that in the style sheet? I really don't have room to crop. This is the code: body { background-image:url('images/RecRm 1.jpg'); background-attachment:fixed;
2
11523
by: yogarajan | last post by:
hi i have create one html file. That file contains background image . but print preview time not display . i am go to tools -> internet options-> advanced options -> printing -> print background colors and images - checkbox enabled that time only appear background image my client donot that step i want default background image with...
16
4906
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...
2
14059
by: thephatp | last post by:
I'm having a problem with IE rendering correctly. I'm experimenting with using all div's in my pages now, and I'm not very familiar with the quirks of IE. I have created a sample page, and I'm really confused as to what is going on in IE. FF renders the page exactly as I expect. IE renders the page with everything in the correct location, but...
3
3201
by: jagdeep gupta | last post by:
i m using two images in master page in same row one image is displayed but not other plz check out code: <table border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%"> <tr> <td style="background-attachment: fixed; background-position-y: center; background-image: url('image/slam11.jpg'); color: #ffcccc;...
0
7276
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...
0
7182
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...
0
7548
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...
0
5714
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...
1
5110
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...
0
4773
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...
0
3267
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...
0
1624
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
488
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...

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.