views:

1532

answers:

8

Been working on this site for some time now, works perfectly on Mac and PC Firefox, as well as Safari. However, IE is making the site almost blank - any ideas on what is going on? Any workarounds?

Thank you in advance for your help!

http://www.alliedprintingsolutions.com

http://www.alliedprintingsolutions.com/style.css (Stylesheet)

A: 

I don't have FireBug on me right now (if you don't have this extension - get it!) But using images in the way you are right now is the problem.

Use CSS to apply a "background-image" attribute for your site's main content. For example:

<style>
.Page
{
    background-image : url(../images/site_bg.png) no-repeat;
    width : 600px; /* Image width here */
    heigth : 500px; /* Image height here */
    padding-top : 15px; /* top text offset here */
    padding-left : 15px; /* left text offset here */
    padding-right : 15px; /* right text offset here */
    padding-bottom : 15px; /* bottom text offset here */
}
</style>

...

<div class = "Page">
 <!-- Content -->
</div>

That will work much better, and will work in all browsers just fine :)

In response to comment

I don't want to say your wrong, but when I can click and drag the background images with my mouse cursor that means that you are using an IMG tag to show the background instead of (or in conjunction with) the background-image attribute. I can almost gurentee that that is your problem. Remove all of your img tags and replace them with divs and the background-image style and your problem will be resolved.

If I had firebug on me I could go into more detail.

Second edit with example code

Here is some rough code that may help you remove your unneccecary image use.

<style>
    .Container { margin : auto; width : 600px; /* BG and Header Width here */ }

    .Header
    {
        background-image : url(../images/site_header.png) no-repeat;
        width : 600px; /* Image width here */
        heigth : 500px; /* Image height here */
        padding-top : 15px; /* top text offset here */
        padding-left : 15px; /* left text offset here */
        padding-right : 15px; /* right text offset here */
        padding-bottom : 15px; /* bottom text offset here */
    }

    .Header .Link1:link, .Header .Link1:visited, .Header .Link2:link, .Header .Link2:visited
    {
        width : 60px;
        heigth : 60px;
        display : block;
        float : left;
        margin : 10 20px;
    }

    .Header .Link1:link, .Header .Link1:visited
    {
        background-image : url(../images/link1.jpg);
    }

    .Header .Link2:link, .Header .Link2:visited
    {
        background-image : url(../images/link2.jpg);
    }

    .Page
    {
        background-image : url(../images/site_bg.png) no-repeat;
        width : 600px; /* Image width here */
        heigth : 500px; /* Image height here */
        padding-top : 15px; /* top text offset here */
        padding-left : 15px; /* left text offset here */
        padding-right : 15px; /* right text offset here */
        padding-bottom : 15px; /* bottom text offset here */
    }
</style>

...

<div class = "Container">
  <div class = "Header">
    <a href = "link1" id = "Link1"></a>
    <a href = "link2" id = "Link2"></a>
  </div>
  <div class = "Page">
    Content
  </div>
</div>

:)

nlaq
I thought that was what I had done? Excuse my novice-ness, but I have a vertical gradient on the body:body,tr,td { background-color: #ffffff; background-image: url(images/vertbg.jpg); ... }And another background on the table:#wrapperbig { background-image: url(images/tablebg.jpg); ...}
It was the only way I could get the centered layout with absolute positioning and a gradient background as well as a background on the table. Very frustrating process, only to have it not work in IE: :(
+10  A: 

Your html is invalid in many ways. Please fix that first.

Kristof Neirynck
Why did this get downvoted? Starting with valid markup makes debugging *much* easier.
Ben Blank
This is a valid answer - incorrect HTML is a very common cause of CSS problems.
Peter Boughton
Agreed. There is no point even beginning to debug CSS without a valid document. Don.t waste your time. +1
Ishmael
The problem is that he is using img tags incorectly instead of div's with background-image attributes. It has nothing to do with him having standard code. Please look at the site and his problems before posting this. Yes, he should be validating - but that is not why he is having problems right now.
nlaq
Oh, and by the way, google dosn't use standard code OR a doctype and it looks fine in all browsers. Doctypes and valid code are certainly important but are not the do-all-end-all solution that makes a bad site look good.
nlaq
And one more thing: most of the errors are "required attribute "ALT" not specified" do you _really_ think that no ALT attribute is causing style issues? If you are going to tell sombody to fix invalid code, look at what the errors are asking him to fix...
nlaq
A better answer would be "Your HTML is invalid, it will make your development experience better if you fix and avoid those errors. However, your particular problem is ..." This just comes off as condescending.
Benry
I think you need to calm down. I can't count the number of times i've seen people argue that the broken HTML is not the problem, only to later have them admit that it was. It's only good etiquette that if you ask someone to help, you give them valid code.
Mystere Man
Benry, most people won't even look at CSS problems if the HTML is broken because broken HTML can cause subtle CSS problems that are impossible to track down without first fixing the HTML, and fixing the HTML is something a monkey can do, just run it through the validator and fix the errors.
Mystere Man
@ Mystere Man, then they could put an "answer" like this in a comment and not answer at all.
Benry
But comments can't be voted up - and this question has at least 8 upvotes (based on it being -2 earlier), proving how important correct code is, which will hopefully encourage the OP to fix things properly (and thus learn) instead of just applying a solution they don't understand. The point of SO is
Peter Boughton
... learning, is it not?(stupid comment size and time limits!)
Peter Boughton
the linked page does not look right in my FF3.
jacobangel
I've been working on it through this convo, which is why it might appear buggy in FF3. I know there are some HTML errors which I am trying to fix, I understand this affects some CSS. Thanks for your help and patience, Nelson. Muchly appreciated. Oh, and by the way, I'm a girl :)
Lots of people are girls, roughly half the world's population. Not an excuse for not having a DOCTYPE though! :P
Peter Boughton
+1  A: 

You may want to try adding a doctype.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"&gt;

Edit: The doctype declaration should be the first thing in the html file. It goes even before the <html> tag.

Zack Mulgrew
Wow, looks like nobody likes HTML 4 transitional, eh?
Zack Mulgrew
+1  A: 

Add a DOCTYPE!

Either HTML5 or HTML4 Strict (not Transitional) are recommended for best cross-browser support.

<!DOCTYPE html>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;


(As you can see, HTML5 is much simpler, and still usable even if you're not yet using HTML5 tags.)


Note: The DOCTYPE must be very first thing in the file, before all other tags, and with no blank lines, tabs, nor spaces before it.

Peter Boughton
HTML4 Transitional is fine, will trigger Standards Mode as long as the full systemId is supplied (as in Zack's comment).
bobince
Zack's answer wont work with some browsers (e.g. older versions of Konqueror). And as you say, the full system id needs to be supplied for even that level of support - it is far simpler to tell people to use Strict mode (or better, the HTML5 doctype), and avoid any confusion.
Peter Boughton
Strict in this case requires more work because it emphasizes structure over presentation. Look at the source of the original page... yowza.
Zack Mulgrew
Strict emphasizes *doing things properly* which is a handy way of avoiding 90% of issues with CSS. A transitional DOCTYPE is shorthand for "I know my code is crap but I can't be bothered fixing it". :P
Peter Boughton
Good catch on the DOCTYPE being the first item though - I've added it to this answer and community wikified. :)
Peter Boughton
Hmmm... so converting to community wiki resets any votes an answer had? Or was this just downvoted at the exact same time? :S
Peter Boughton
A: 

Had a quick look at the code in firebug. You seem to have a z-index of -1 on the content div (#wrapperbig), which browsers should ignore for non-absolute/relative content - this may be an odd implementation in IE.

Also, as mentioned before, add a doctype - IE will render the site in 'quirks mode' if there is no doctype.

Donald Harvey
+1  A: 

The Quick Solution: Remove "overflow: auto;" from #wrapperbig and #wrapper.

This will get the content to be displayed.

However, be sure to look at the other answers. They have good points.

Paxenos
This did help show the content in IE, but you're right, there are some other errors I need to hammer out. Thanks for the tip, though. :)
A: 

There are too much woo-doo stuff happening with absolute positioning of content_left and content_right. You will be fine by removing “position: absolute” and replace it with “float:left” in both content’s (set wrapper width to 100%).

LicenseQ
A: 

Thank you for all your suggestions, everyone. The majority of the content is showing up (relatively as it should be) on IE now, other than the footer which is slicing up my page in a gross fashion (haha). I see what youre saying, Nelson LaQuet, about the header images, I will have to try and play around with them, I'm still new to CSS and figuring out to having them all properly placed with an image map was headache enough as is. As for the Doctype, I added it as you told me and it seemed to muck up some content even on Firefox, so I know I must have some more errors to go through. When I remove it, things looked normal again. The "woowoo's" with the absolute positioning were pretty much necessary, as the positioning method used was the ONLY way I could find to work with the background images and header images in tact, with the column divs in the correct place. At least I made some positive progress it, but I guess I have more work ahead of me :/ Just wish it was a bit easier to correct as it looks just fine in Firefox. Oh well, thanks again for all your help, guys!

Shannon