Is it possible for me to have multiple backgrounds?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mariko
    New Member
    • Mar 2010
    • 23

    Is it possible for me to have multiple backgrounds?

    I want a background that is the size of the viewer's screen, and I want another background that is 800pixels at all times. The 800 pixel one should be centered and behind the content of my web page. I don't want images, just two different colors. Is there a way for me to do that?
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    you can have only one background-image/color per element. not using images would mean, you need two different elements (<div>) with appropriate styles.

    Comment

    • TheServant
      Recognized Expert Top Contributor
      • Feb 2008
      • 1168

      #3
      If you have a structure like:
      Code:
      <div style="background-color: blue; width: 100%;">
      <div style="background-color: red; width: 800px; margin: 0 auto;">
      <p>This is your text!!!</p>
      </div>
      </div>
      Then you can replace the <p>aragraph with even more div's or other elements if you want. Also, I recommend doing it all in a nice CSS file so you don't need to be messy like my example ;)

      Comment

      Working...