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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Feb 2003
    Location
    Brooklyn, New York
    Posts
    149
    Thanks
    0
    Thanked 0 Times in 0 Posts

    background picture on web

    Hi Folks,

    I tried to use a picture for a background but if viewed on a higher screen size it tiles. Here's the link maybe you can tell what I'm doing wrong. www.mcd4x4.com/alana.htm
    BrianNY/Rookie

  • #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
    A background image will tile to fit the resolution unless you tell it not to. Would you want it centered and not to repeat?
    Code:
    <style type="text/css">
    <!--
    body {
    background-image:url(alanaspage/3-19-05/page1.jpg);
    background-position:center;
    background-repeat:no-repeat;
    background-color:#FFFFFF;
    }
    -->
    </style>
    you can add that in your head tags to make it not repeat, it will center on any resolution.

  • #3
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you want a non-repeating background - so it doesn't tile - then do something like so -

    body {
    background: url(picture.jpg) no-repeat;
    }

    Although, then in larger resolutions, the background will stop half way. I don't think you can stretch the background to cater for all resolutions.

    EDIT: Darn, was beaten to it.

  • #4
    Regular Coder
    Join Date
    Feb 2003
    Location
    Brooklyn, New York
    Posts
    149
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So than the css sounds like the way to go?
    BrianNY/Rookie

  • #5
    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
    css is the standards way to go, you could use the old html attributes like bgpropties="fixed" or bgcolor="blah" but thats deprecated and shouldn't be used. CSS should be used in place of it.


  •  

    Posting Permissions

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