SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: background images and CSS
Hybrid View
-
Jan 13, 2009, 17:46 #1
- Join Date
- Sep 2008
- Posts
- 72
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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!
-
Jan 14, 2009, 00:07 #2
- 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.
-
Jan 14, 2009, 04:20 #3
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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
-
Jan 14, 2009, 07:03 #4
- Join Date
- Sep 2008
- Posts
- 72
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
That is exactly what I needed.
Thanks both!
Polly
Bookmarks