Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Image FireFox Issue

    --------------------------------------------------------------------------------

    I still can't figure this issue out.. Everything works fine in IE, but not in firefox.

    Part of my CSS file looks like this:

    body
    {
    background: #006666;
    margin-left = .5cm;
    margin-right = .5cm;
    margin-top = .5cm;
    margin-bottom = .5cm;
    }

    #leftside
    {
    background-image = url("/styles/marble.gif");
    height: 100%;
    width: 100%;
    }

    HTML:

    <html>
    <head>

    <title>TITLE<title>
    <link rel=stylesheet type="text/css" href="/styles/style.css">

    </head>

    <body>

    <div id="leftside">
    <table border="1" width="100%" >
    CONTENT
    </table>
    </div>
    </body>
    </html>

    It will display the image in IE, but not in firefox.. Also another thing I noticed, is that when I take the image out and just put in a color aka background: #EEEEEE. It will fill the background color of the table, but when I do the image, as you can see above, it will not work!!!! Someone please help. I have tried everything/looked everywhere.

  • #2
    Regular Coder
    Join Date
    Jul 2007
    Posts
    571
    Thanks
    25
    Thanked 28 Times in 28 Posts
    1. Makse sure the url to the image is correct
    2. Try adding the other properties so firefox knows what to do:

    ex:
    Code:
    background: #SOMECOLOR  url("/styles/marble.gif") no-repeat top left;
    3. Don't use tables for you layouts! it's is very bad coding practice.

  • #3
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Got it.. Thank you!!!
    Last edited by hyp3rk1d; 01-09-2008 at 02:37 PM.

  • #4
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,302
    Thanks
    28
    Thanked 276 Times in 270 Posts
    Quote Originally Posted by hyp3rk1d View Post
    Part of my CSS file looks like this:

    body
    {
    background: #006666;
    margin-left = .5cm;
    margin-right = .5cm;
    margin-top = .5cm;
    margin-bottom = .5cm;
    }

    #leftside
    {
    background-image = url("/styles/marble.gif");
    height: 100%;
    width: 100%;
    }
    That syntax is wrong, wrong, wrong! It should be like the following:

    Code:
    body 
    {
    background: #006666;
    margin-left: .5cm;
    margin-right: .5cm;
    margin-top: .5cm;
    margin-bottom: .5cm;
    }
    
    #leftside
    {
    background-image: url("/styles/marble.gif");
    height: 100%;
    width: 100%;
    }
    Or, better yet, let’s go for some efficiency by using shorthand and removing stuff that’s not doing anything:

    Code:
    body { margin: 0.5cm; background: #066; }
    #leftside { width: 100%; background: url("/styles/marble.gif"); }
    Tangential Information
    You forgot the document type declaration that’s supposed to go at the top of your document:

    Code:
    <!doctype html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html401/strict.dtd">
    There are several other available declarations too, but this is the one that I recommend.

    Lastly, it can’t be repeated enough: “Don't use tables for you layouts! it's is very bad coding practice.” (quote courtesy of srule_)
    Last edited by Arbitrator; 01-10-2008 at 08:21 AM. Reason: I added the width declaration to the second revised style sheet since it actually has an effect.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #5
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Quote Originally Posted by Arbitrator View Post
    There are several other available declarations too, but this is the one that I recommend.
    I'm surprised at you, Arbitrator: I thought you'd be the first to link to our lovely sticky on the subject!

  • #6
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the responses.. I am fairly new to all this.. Now I cant seem to extend that image all the way across the page.. When scrolls are added to the page in order to view more information to the right, if you scroll right you see the background color. The image does not extend in firefox, but it does in IE

  • #7
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Got link? Got code? We can't see your code nor can we see your images.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #8
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    body
    {
    background: #006666;
    margin-left: .5cm;
    margin-right: .5cm;
    margin-top: .5cm;
    margin-bottom: .5cm;
    }

    #leftside
    {
    background-image = url("/styles/marble.gif");
    height: 100&#37;;
    width: 100%;
    }

    HTML:

    <html>
    <head>

    <title>TITLE<title>
    <link rel=stylesheet type="text/css" href="/styles/style.css">

    </head>

    <body>

    <div id="leftside">
    <table border="1" width="100%" >
    CONTENT
    </table>
    </div>
    </body>
    </html>

  • #9
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    If you would quote your entire code it would better - use the CODE TAGS like I have.
    And, like _Aerospace_Eng_ says, we still can't see your images so a link to a test site would be even better.

    Try this:

    Code:
    body 
    {
    background: #006666;
    }
    
    #leftside
    {
    background: url("/styles/marble.gif");
    margin: 5cm;
    height: 100&#37;;
    }
    
    HTML:
    
    <html>
    <head>
    
    <title>TITLE<title>
    <link rel=stylesheet type="text/css" href="/styles/style.css"> 
    
    </head>
    
    <body>
    
    <div id="leftside">
    CONTENT
    </div>
    </body>
    </html>
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #10
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    mid-height works in order to get it to fill all the table..

    why doesnt mid-width work???


  •  

    Posting Permissions

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