SitePoint Sponsor

User Tag List

Results 1 to 15 of 15
  1. #1
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE CSS Stylesheet problem

    Hi, I created my site and have a main stylesheet. Everything works fine in FF, but in IE7, many of the attributes do not work. However, if I use inline coding within a tag, then I can see the css effects.

    For example:

    <td class="my_bgimage"> Will not show the background image and it's bottom position, but

    <td style="background: url(background.jpg) no-repeat; background-position: bottom;"> Works fine.

    Any idea why my stylesheet is not being read properly by IE but no problem with FF?

  2. #2
    SitePoint Addict
    Join Date
    Sep 2001
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i think u need to post the code you're using to link to the stylesheet. maybe even post the page live so we can debug it for you
    Steve Davis

  3. #3
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by CraniumDesigns View Post
    i think u need to post the code you're using to link to the stylesheet. maybe even post the page live so we can debug it for you
    Here's how I'm linking to the stylesheet:

    <link rel="stylesheet" href="default.css" type="text/css" media="all">

  4. #4
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh and here's a page to the code:

    http://tinyurl.com/3xsdek

    I have the background image working now only because of the inline coding. The area you can focus on is class="main_content_cell".

    Thanks!

  5. #5
    SitePoint Addict
    Join Date
    Sep 2001
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    man, i'm stumped on this one, but i'm still kind of a newb in css. i'm sure one of the mods can help.
    Steve Davis

  6. #6
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just took out the inline coding so that you can see how the css stylesheet works in Firefox but not in IE.

  7. #7
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Unfortunately I'm downloading Internet Explorer 7 on a dialup connection (just recently reinstalled Windows XP Pro) so I really can't help you right now.

    Have you validated your HTML and CSS? Have you checked to see that the image appears in IE 6? Are your image file paths correct?

    I'd check those before doing anything else (while I suffer through dialup Hell updating my OS).

  8. #8
    The Mind's I ® silver trophy Dark Tranquility's Avatar
    Join Date
    Sep 2003
    Location
    KSA - UAE
    Posts
    9,457
    Mentioned
    8 Post(s)
    Tagged
    1 Thread(s)
    Well don't use inline style!
    Your CSS and HTML aren't valid:
    http://jigsaw.w3.org/css-validator/v...usermedium=all
    http://validator.w3.org/check?uri=ht...Inline&group=0

    you even have 34 HTML errors fix them

  9. #9
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Damn, let me look into all those!

  10. #10
    SitePoint Wizard rguy84's Avatar
    Join Date
    Sep 2005
    Location
    Durham, NC
    Posts
    1,659
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    I imagine if you fix your CSS errors, it will be a lot happier. I would do those first. Most of your errors in the html validator are for ALT tags. Although they are very important, leaving them out wouldn't give this problem you have.
    Ryan B | My Blog | Twitter

  11. #11
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    HI,

    Running the css through the validator would have fixed this in about 10 seconds.

    you have stray text here:
    Code:
    
    .page_content a:visited    {
        color:    #990000;
        background-color: transparent;
        }she'ss
    That text is causing the stylsheet to be broken and somethings gotta give.

    You also have missed commas here:

    Code:
        .site_map {
        color:            #5D0001;
        font-family:     "Trebuchet MS", verdana, geneva, sans-serif;
        font-size:         9pt;
        line-height:    12pt;
        letter-spacing: -0.5px;
        margin-left:     0;
        margin-top:     0;
    }
    
    .nav_links {
        color:            #232323;
        font-family:     "Trebuchet MS", verdana, geneva, sans-serif;
        font-size:         9pt;
        line-height:    11pt;
        letter-spacing: -0.5px;
        margin-left:     0;
        margin-top:     0;
    }
    Fix those and the background will show

  12. #12
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rguy84 View Post
    I imagine if you fix your CSS errors, it will be a lot happier. I would do those first. Most of your errors in the html validator are for ALT tags. Although they are very important, leaving them out wouldn't give this problem you have.
    I'm sure you meant alt attributes, not tags.

  13. #13
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks everyone, I fixed it all. The problem was definitely in the css stylesheet. There were some characters inserted in the middle of the document that had no reason being there. Time to start color coding my code!

  14. #14
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by weboy

    I fixed it all.
    I think you'll find that I fixed it for you

  15. #15
    SitePoint Wizard rguy84's Avatar
    Join Date
    Sep 2005
    Location
    Durham, NC
    Posts
    1,659
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Schulz View Post
    I'm sure you meant alt attributes, not tags.
    Of course. But then again it was 8am here.
    Ryan B | My Blog | Twitter


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •