Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    Jan 2011
    Posts
    148
    Member #
    26229
    Liked
    1 times
    [COLOR=rgb(0, 0, 0)]Hi there,

    Got a quick questions about a site I'm designing,

    I've designed a background image that makes up the header for each page on the site, on the homepage for example the image size is fine and it makes up the whole screen.
    However on pages where there is a lot of content it would be necessary to make the image quite big in order to fill the page. It also means that when adding content and making the page bigger I will need to increase the size of the background image.

    Using image repeat won't work as it would mean repeating the page header.

    I was wondering if it's possible to have a centred image on the page but then upload a separate image that can be repeated in any space not covered by the original.

    Hope this makes sense? any help would be greatly appreciated.

    Thanks,
    John
    [/COLOR]

  2.  

  3. #2
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    Put the image you want to repeat as the background of the header div, and set it's width to 100%. Then, place a div inside that one the width and height of the image you want for the header and set that image as the background for that div.

    Like so:
    HTML:
    HTML Code:
    <div id="header_wrap">
        <div id="header_inside">
        </div>
    </div>
    CSS:
    Code:
    #header_wrap{
    background: url('images/bg_header.png') repeat-x;
    height: 80px;
    width: 100%;
    }
    #header_inside{
    background: url('images/bg_header_inside.png') no-repeat;
    height: 80px;
    margin:0 auto;
    width: 800px;
    }
    And, of course, change the height and width values and filenames to yours.
    TheGAME1264 likes this.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  4. #3
    Senior Member
    Join Date
    Jan 2011
    Posts
    148
    Member #
    26229
    Liked
    1 times
    Thanks very much, this is very helpful.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:44 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com