SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2008
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question background images and CSS

    I'm trying to learn enough HTML/CSS to move my church's website from tables to CSS.

    We use one image [a drawing of the church] as background on the index page, and then another image [a screened version of that drawing] as background on all the other pages.

    Does that mean that I can't use CSS to set a background image?

    Thanks!

  2. #2
    SitePoint Zealot
    Join Date
    Dec 2008
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, i think, that depends on which cms you are using if using one.

    The idea is to use different classes for different pages - i mean, applying different classes to the Body tag.

    So, the remaining question is - are you able to use differrent classes on the Body tag and how it would be convenient to you to use them.
    A huge list of resources for designers and content producers
    to buy, sell or share stock photo images and other content.

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pellerbe View Post
    Does that mean that I can't use CSS to set a background image?
    Not at all! You just need a way to differentiate between the two types of page. For instance, you can add an ID (or a class) to the <body> tag on your index page:
    Code HTML4Strict:
    <body id="start">

    Then use two CSS rules: one that applies for all pages and one that overrides that rule for the index page:
    Code CSS:
    /* This rule applies to all pages. */
    body {background-image:url("screened.jpg")}
     
    /* This rule overrides the preceding one for the index page. */
    body#start {background-image:url("church.jpg")}
    Birnam wood is come to Dunsinane

  4. #4
    SitePoint Enthusiast
    Join Date
    Sep 2008
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile

    That is exactly what I needed.

    Thanks both!

    Polly


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
  •