Jump to content

Background wont show in I.E.


fry2010

Recommended Posts

I have looked around everyone for a solution so this is my last resort really.

Everywhere else describes the same solution but it still fails to work.

What I have is a background image reapted-x horizontally accross the very top of the page. I have placed this in the <body> tag, not in a containing div. I have tried using background: #ffffff url('.....') repeat-x top left; and also tried the long method of declaring all background rules i.e. background-image: url('....'); background-repeat: repeat-x; etc.....

It shows in firefox but not in i.e. 7 I am not sure about earlier versions of i.e. as I dont have them.

My page validates at w3c.

 

I have also tried declaring a set width and height and position: relative; and position: absolute;

Nothing is working.

 

My original thought was that I shouldnt use a background image in the body tag, but i tried to put in another container and still no luck.

 

Does anyone have any ideas on what I should try?

Also I have declared a doctype at the start of every html document and it parses correctly so its not i.e. going into quirks mode.

Any help appreciated.

 

Link to comment
https://forums.phpfreaks.com/topic/149142-background-wont-show-in-ie/
Share on other sites

here is part of the css code:

*, html{
margin: 0;
padding: 0;
}

body {
background-image: url(images/header_01.gif);
background-repeat: repeat-x;
text-align: center;
}

html, body {
min-height: 75%;
height: 75%;
}

 

and the html code (shell):

<html>
<head><title>TITLE</title></head>
<body>
  <div id="wrapper">
    <div id="header">
      <p>Login stuff goes here and title</p>
    </div>
    <h1>SOME TEXT</h1>
    <p>SOME TEXT</p>
    <div id="footer">
      <p>FOOTER</p>
    </div>
  </div>
</body>
</html>

 

 

 

Ok I have sorted it kind of now.

For anyone else that comes accross a similair problem you may want to check how you set your doctype with the http-equiv tag. I was using UTF-8 encoding, changed it to the iso standard and now things are working (kind of) correctly.

For some reason I have a habit of using UTF-8 as encoding I dont know why I think its because in my early days I read a book that suggested to use this. But its stil not well supported so I recommend to avoid the use of UTF-8.

Also internet explorer is the biggest piece of sh*t ever made.

Yeah you are sort of correct on that. There was one document that wasnt actually saved as UTF-8 the rest where including my css sheet. The other problem was I wasnt sending out the doctype decleration before any other header info in the php code, except of course session_start(); which must go before anything. So it was just a bit of juggling around, but I still using ASCI not UTF-8 as its the norm on most other sites. Sorted now either way, and a few lessons learned.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.