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 3 of 3
  1. #1
    New Coder
    Join Date
    Dec 2008
    Posts
    81
    Thanks
    11
    Thanked 1 Time in 1 Post

    How to stretch and repeat an image for background

    I need to create a background image for my top navigation for website so instead of creating a long stretched image which will be big I need to create a small image/strip that will be repeated across the width so that it will be a very tiny image and will not slow my website.

    So lets say my navigation is (Width X Height) 900px X 10px I will make a small strip of 10px X 10px and then repeat it across the width.

    Sorry its a dumb question but I am new to CSS.

  • #2
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    Code:
    background: url('image.png') repeat;
    or separately:
    Code:
    background-image: url('images.png');
    background-repeat: repeat-x;
    or
    background-repeat: repeat-y;
    or
    background-repeat: repeat; (both x&y)

  • Users who have thanked Sammy12 for this post:

    misheck (11-04-2011)

  • #3
    New Coder
    Join Date
    Dec 2008
    Posts
    81
    Thanks
    11
    Thanked 1 Time in 1 Post
    Thanks for the help.


  •  

    Posting Permissions

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