Results 1 to 24 of 24

Thread: HTML Body Background

  1. #1

    Thread Starter
    Hyperactive Member PITBULLCJR's Avatar
    Join Date
    Nov 1999
    Location
    New York
    Posts
    408

    HTML Body Background

    Well I know you can do this
    <body background="happy.jpg">
    that will put happy as the background image....Now is there a way to have it strecth perfectly to the size of the persons brower size...Because if you have a cool background that fits perfectly for 800X600 its not going to work at larger sizes or smaller sizes so is there a way to have it fit automatically?
    Sincerely,
    Chris


    Email: [email protected]
    AIM: KnightsOfTheMoon
    WebPage: http://kom.wicre.com
    ----------------
    VB6 Professional
    Abit ST6-RAID
    1000 MHZ
    512 MB PC133 Ram
    Nvidia GeForce 2 Ultra 64 MB
    Maxtor 81.9 Gig
    Win 98 SE

  2. #2
    scoutt
    Guest
    if the jpg is only 800x600 it will not stretch to accomodate for 1024x768, it will tile and start over. you should have another one for that size.

    there is no code for that if I'm not mistaken.

  3. #3
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    nope, i don't think that is possible.

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  4. #4
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    2 Choices.

    You can have the picture centered on your page...

    or you can have a javascript determine which background image should be shown depending on what resolution they have.


    http://www.htmlgoodies.com/beyond/cssbg.html


    I suggest having a look at this site - you may find it useful ^^^

  5. #5
    Lively Member
    Join Date
    Aug 2001
    Posts
    82
    make different sized images for different sized screens and use javascript do the hard work and hope that every one has a browser that will work with the javascript you wrote

    or "fix" the size of the page using a table.

    both methods could keep the image from tiling side-to side, but up and down, it would not fix...

    Only one drawback; what happens if the page scrolls down after the image ends? It wraps, gets ugly and your back at square one.
    If you think I am wierd, then thats YOUR problem!

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

    I keep snakes and lizards, wanna know more? PM me

  6. #6
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    the table method is probably the best, i have used it before too.

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  7. #7
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    try and make your picture recursive so that it would appear to be just a massive picture if they scrolled?

  8. #8
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604
    or you can do what i have done on my website, and use javascript to resize thw window to 800x600 so that the picture looks good

    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

    [Galahtech.com] | [My Site] | [Fishsponge] | [UnixForum.co.uk]

  9. #9
    scoutt
    Guest
    Originally posted by zmerlinz
    or you can do what i have done on my website, and use javascript to resize thw window to 800x600 so that the picture looks good
    that would piss me off. if I was running 1024x768 and you resized my browser to 800x600 I would leave. and if I was on 800x600 you wouldn't even do anything.

  10. #10
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    from my experiences, the best two options are as follows:

    1) put the whole site in a fixed table, and make the BG the BG of the table.

    2) make a bg that seamlessly repeats.

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  11. #11
    Lively Member
    Join Date
    Aug 2001
    Posts
    82
    Try this:

    Make a couple different sized images for the background, say, 640 x 480, 800 x 600 and 1024 x 768 (for example - these are settings my computer has)

    use javascript to detect the visitors screen size and plop the right background into the page. Add a little extra html to the body attribute in the script to fix the background so that will (hopefully) eliminate the scrolling should the page be longer then the image. Hope the script that you wrote is cross-platform and you should be set.

    BTW the extra html to keep the background image from scrolling and tiling is:
    Code:
    
    <body background = "image.gif" bgproperties = "fixed">
    
    Netscape 6 don't dig the bgproperties tag
    If you think I am wierd, then thats YOUR problem!

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

    I keep snakes and lizards, wanna know more? PM me

  12. #12
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    lol, i posted a link to that example ^^^

  13. #13
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604
    Originally posted by scoutt

    that would piss me off. if I was running 1024x768 and you resized my browser to 800x600 I would leave. and if I was on 800x600 you wouldn't even do anything.
    sorry if that would annoy you, but that is the way that it is on my site, and from a little questionnaire i did a little while ago, most people visit my site at 800x600 anyways,

    you can maximise the window, it is just that the picture tiles, and it takes too long to download the picture as it is, i did try compressing the picture but then the quality is really poor

    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

    [Galahtech.com] | [My Site] | [Fishsponge] | [UnixForum.co.uk]

  14. #14
    scoutt
    Guest
    that is funny, NS totally ruins your site there zmerlinz. have you been to it in NS4.x??

  15. #15
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604
    yeah the other day, it really annoys me, i think i might change it at some point, at the minute i can't be bothered

    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

    [Galahtech.com] | [My Site] | [Fishsponge] | [UnixForum.co.uk]

  16. #16
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    my philosiphy is just to worry about NS6.. It's actually good!

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  17. #17
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604
    it is

    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

    [Galahtech.com] | [My Site] | [Fishsponge] | [UnixForum.co.uk]

  18. #18
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    i'm dead serious!

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  19. #19
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604
    if you say so, personally i like IE, i know that it is a Micr$oft program but it is quite user friendly and when i try and use another browser i find that i have to learn a new set of short-cut keys and i can't be arsed to do that, i guess i am just stick in my way

    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

    [Galahtech.com] | [My Site] | [Fishsponge] | [UnixForum.co.uk]

  20. #20
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    well, IE is my primary browser. I just said NS6 was good

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  21. #21
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604
    so it isn't that good as you are still using IE

    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

    [Galahtech.com] | [My Site] | [Fishsponge] | [UnixForum.co.uk]

  22. #22
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    ....probably. i guess i just use IE because it is so integrated with windows, that it is hard for NS to compete.

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  23. #23
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604
    i used to like Opera, but i found out that it uses more resources that IE does and again i am just too used to IE what with it being inergrated in all, looks as if Microsofts little plan paid of then

    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

    [Galahtech.com] | [My Site] | [Fishsponge] | [UnixForum.co.uk]

  24. #24
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    Netscape tried to sue microsoft for that plan i think

Posting Permissions

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



Click Here to Expand Forum to Full Width