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 15 of 15
  1. #1
    New Coder
    Join Date
    Jan 2005
    Location
    Toronto
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    why .GIF image works well for background but not .JPEG

    Hi,

    Could somebody help and explain why?
    I just write a simple html file to test the background with .GIF image and it works fine but it doesn't work for .JPEG image. I have Window XP professional.

    Thanks for your help and reply.

    Ramy.

  • #2
    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
    what does your coding look like? file names are case sensitive so if you image is saved as .JPG and your code is to a .jpg it wont work, same with gifs and any other image files, can u post your code plz? and possibly the images?

  • #3
    New Coder
    Join Date
    Jan 2005
    Location
    Toronto
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    Thank you for your help, the code is below

    --------------------------------------------------------
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html><head><title>My main Page</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

    <style type="text/css">
    .table {
    text-color: #708090;
    text-align: center;
    position: absolute;
    height: 4em;
    width: 22em;
    left: 50%;
    top: 50%;
    margin-left: -(width/2)em;
    margin-top: -(height/2)em;
    z-index: 100;
    background: 747.GIF;
    foreground-color: #708090;
    background-color: #ddddee;
    border-top: 1px solid #333366;
    border-left: 1px solid #333366;
    border-right: 3px solid #333366;
    border-bottom: 3px solid #333366;
    }
    body {
    font-family: sans-serif;font-color: red;
    }
    </style>
    </head>

    <body background="748.JPEG">
    <h2> Hello World! </h2>
    <TABLE BORDER CELLPADDING="8" CELLSPACING="4" COLS="3"
    background="747.gif">
    <TR>
    <TD>
    <IMG SRC="mainPage.jpeg" width=200 height=100 ALT="orange.JPEG"
    USEMAP="#mainmap">
    </TD>
    <TD>
    <IMG SRC="747.GIF" width=200 height=100 ALT="heart.jpeg"
    USEMAP="#mainmap">
    </TD>
    </TR>
    </TABLE>
    </body></html>
    ---------------------------------------------------------
    if I change

    <body background="748.JPEG"> to <body background="747.GIF"> it works fine
    but it doesn't work as <body background="748.JPEG">.

    Once again thank you very much.

    Ramy.

  • #4
    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
    what is the jpeg saved as? the exact file name? is it .JPG or .JPEG? and your coding is not HTML Strict well at least not according to the validator http://validator.w3.org/

  • #5
    New Coder
    Join Date
    Jan 2005
    Location
    Toronto
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    yes, it is saved as 748.JPEG.
    I dont know how to attach the image to this site or else you could of test it out yourself and see the problem.
    Once again, Thank you very much.

    Ramy.

  • #6
    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
    you would click manage attachments under the submit button, but lets try this, rename the file to 748.jpg and and adjust it to your background also

  • #7
    New Coder
    Join Date
    Jan 2005
    Location
    Toronto
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    I tried to rename it to 748.jpg by right click on the image but i am so sure if i am allow to do that. anyway it doesn't seem to work. I will attached for you to try, according to http://validator.w3.org/, i might have some issue with my server. Could you please try on your to see if it work.
    Once again, thank you very much.
    Attached Images Attached Images  

  • #8
    New Coder
    Join Date
    Jan 2005
    Location
    Toronto
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi,

    here is the other 747.GIF image that work.
    sorry, .GIF image is not valid for upload.
    Thanx.

  • #9
    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
    it is valid but its the file extension, its uppercase, why can't you change the file name it doesn't make a difference as long as it works right? anyways, i tried what u did with the 748.JPEG as a background and it works fine
    Last edited by _Aerospace_Eng_; 02-11-2005 at 06:50 AM.

  • #10
    New Coder
    Join Date
    Jan 2005
    Location
    Toronto
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    hi

    Hi,

    If I can't resolve this problem then i have to choose a different image as background but I spend too much time on creating the .JPEG image. anyway,
    Could you please help me with a another problem?

    How can I apply the style/css as in my code to the table? that is my html file consist of a table right, so how can I apply the following code:

    --------------------------
    <style type="text/css">
    .table{
    text-color: #708090;
    text-align: center;
    position: absolute;
    height: 4em;
    width: 22em;
    left: 50%;
    top: 50%;
    margin-left: -(width/2)em;
    margin-top: -(height/2)em;
    z-index: 100;
    foreground-color: #708090;
    background-color: #ddddee;
    border-top: 1px solid #333366;
    border-left: 1px solid #333366;
    border-right: 3px solid #333366;
    border-bottom: 3px solid #333366;
    }
    body {
    font-family: sans-serif;font-color: red;
    }
    </style>
    ---------------------------
    to the table, is it by inserting ".style.display = ' ' '' in
    <TABLE BORDER CELLPADDING="8" CELLSPACING="4" COLS="3"
    style.display = " ">

    I tried but it doesn't work.
    Once again, thanks a lot.

    Ramy.

  • #11
    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
    Code:
    <TABLE BORDER CELLPADDING="8" CELLSPACING="4" COLS="3" class="table">
    i am not really sure what you are trying to do with
    Code:
    margin-left: -(width/2)em;
    margin-top: -(height/2)em;
    i've never seen that before, im not even sure if it event works, u can't put javascript which is what it looks like into css, for your body css try using this
    Code:
    body {
    font-family: sans-serif;
    color: red;
    background-image:url(748.JPEG);
    }

  • #12
    New Coder
    Join Date
    Jan 2005
    Location
    Toronto
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    Thanks for all the helps.
    I will try that ASAP.

    Ramy.

  • #13
    Regular Coder
    Join Date
    Jun 2002
    Location
    Canada
    Posts
    253
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the image you uploaded to this forum is named "748.jpg" works ok for me.
    you should be able to upload that to your own space and change the BODY tag to this...
    <body background="748.jpg">

    looking at your css part, i noticed this part...
    margin-left: -(width/2)em;
    margin-top: -(width/2)em;
    the values dont look like any ive ever seen. is it valid?

    same with these ones...
    foreground-color: #708090;
    background-color: #ddddee;
    also ones i have never seen before. are they valid?

    in your css is this part, this one...
    text-color: #708090;
    should be changed to this...
    color: #708090;

    also in your css is this...
    background: 747.GIF;
    it should be changed to this...
    background-image: url(747.GIF);

    if the image still does not work for your background, perhaps provide a link to your webpage as something else may be in error.

  • #14
    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
    Quote Originally Posted by _Aerospace_Eng_
    Code:
    <TABLE BORDER CELLPADDING="8" CELLSPACING="4" COLS="3" class="table">
    i am not really sure what you are trying to do with
    Code:
    margin-left: -(width/2)em;
    margin-top: -(height/2)em;
    i've never seen that before, im not even sure if it event works, u can't put javascript which is what it looks like into css, for your body css try using this
    Code:
    body {
    font-family: sans-serif;
    color: red;
    background-image:url(748.JPEG);
    }
    umm is that not what i just said?

  • #15
    Regular Coder
    Join Date
    Jun 2002
    Location
    Canada
    Posts
    253
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by _Aerospace_Eng_
    umm is that not what i just said?
    yeah, sorry. my fault for skimming and only half reading stuff.


  •  

    Posting Permissions

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