SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Two Backgrounds

  1. #1
    SitePoint Guru
    Join Date
    Jan 2010
    Posts
    638
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Two Backgrounds

    Sitepoint Members,
    My background is taking too long to load, resulting in a white flash as the page loads. I would like to have a solid color as a background until the desired background takes effct. Is the best way to do it is to have two backgrounds in the CSS list?

    Thanks for the help,


    Chris

  2. #2
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,286
    Mentioned
    121 Post(s)
    Tagged
    1 Thread(s)
    Unless I'm missing something, all you need to do is set the color on the background as well as the URL for the image you're trying to load

    http://reference.sitepoint.com/css/background
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style
    Learn how to be ready for The Forums' Move to Discourse

  3. #3
    SitePoint Guru
    Join Date
    Jan 2010
    Posts
    638
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Dave,
    Thanks for writing.

    So for example

    body{background-color:#CC6633;background:url(/xy.jpg) repeat fixed}

    would work? It seems too easy. You would think it would cause some sort of redundancy error.


    Thanks,

    Chris

  4. #4
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,724
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    You could shorten that and use the background property

    body{background:#CC6633 url(/xy.jpg) repeat fixed}


    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  5. #5
    SitePoint Guru
    Join Date
    Jan 2010
    Posts
    638
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Ryan,
    I did make that change and the code works fine. Unfortunately I'm still gettig the flash of white and the background solid color shows for probably a 1/10th of a second after the white flash. I remember now that in the past the white flash occured when I made big changes (a lot of code), or maybe it's big changes to one or more php files, and about 5 or 6 days later the white flash goes away. Any thoughts on what cuases that?

    Thanks,

    Chris

  6. #6
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,724
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Uh...no clue. I wouldn't worry about it.
    Always looking for web design/development work.
    http://www.CodeFundamentals.com


Bookmarks

Posting Permissions

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