Results 1 to 3 of 3
  1. #1
    Join Date
    May 2010
    Posts
    15
    Plugin Contributions
    0

    Default Css background img + background color

    Hi, I want a background img and also background color, because the background image is not that big, just half the page and then the rest is white color, but then i want same color as the background have at the bottom so it looks like they are connected, but how to do this, i know i have done this before...

    body {
    margin: 0;
    font-family: arial, helvetica, sans-serif;
    font-size: 0.72em;
    color: #333333;
    background: #000000;

    background: url("http://www.spacetelescope.org/static/images/background.jpg") repeat-x;
    line-height: 17px;
    }


    ^^ that how it looks in my css, but only the image is showing not the baground color i have choosed there, i also tried with background-color: #0000000 but that didnt work either, if i remove the image then its black #0000000 color at the background but not when i have image background 2, i want them both.... i have fresh install, nothing changed....

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,655
    Plugin Contributions
    25

    Default Re: Css background img + background color

    You're setting your background twice, so the second one replaces the first.

    When you had the color listed separately the same thing happened, since the "background" style replaces all the individual elements that preceded it such as background-color.

    You have two options:

    either use backround-color, background-image, etc to set each part separately

    OR

    combine them into a single statement such as
    background: #000000 url("http://www.spacetelescope.org/static/images/background.jpg") repeat-x;
    See and test drive Zen Cart's free templates at zencarttemplates.info

    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    May 2010
    Posts
    15
    Plugin Contributions
    0

    Default Re: Css background img + background color

    ahh yes now it worked!
    Thanks man, really appreciate it!

 

 

Similar Threads

  1. Can't change background color? (or any color, for that matter)
    By philanthropybooks in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 6 Oct 2009, 03:26 AM
  2. Background color and IE 6 and IE 7
    By marylouj in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 3 Jul 2009, 01:03 AM
  3. Background color
    By confused_aswell in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 19 Jun 2008, 09:55 PM
  4. Background Color
    By 14kvision in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 15 Jun 2008, 06:04 PM
  5. Background Image & Background Color
    By jben in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 30 Mar 2008, 01:11 AM

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
  •