/    Sign up×
Community /Pin to ProfileBookmark

CSS & Templates? Image Rotation How to…

Really quick — and probably simple question. If you save a css file as a template for your website, how can you ensure that say — all five pages of your site have a different image. For instance, the template has a promotional area where an image is located. How would you go about ensuring that Pages 2, 3, 4, and 5 have different images if you are using CSS as your template?

Thanks.

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@ryanbutlerNov 12.2007 — I'd just google for JavaScript or PHP image rotator script...thousands are available.

Either that or if your image area is in a DIV, create extra DIV's with different images and then apply that to each page, i.e.,

[CODE]<div id="rotate">

</div>[/CODE]


Page 2

[CODE]<div id="rotate_about">

</div>[/CODE]


CSS:

[CODE]#rotate_about{
background-image:url(myimage.jpg);
}[/CODE]


Hope it helps,
Copy linkTweet thisAlerts:
@scragarNov 12.2007 — css doesn't make good for templates(only styling the templates you already have in HTML), but you could give your pages all unique IDs to the body:
[code=html]<body id="homepage">[/code]then use the CSS to style an object different based on page:
body#homepage div#uniqueBG{
background-image: url(IMG);
}
but that requires the use of background images and special styling, as well as editing the HTML for all the pages as well. rather a lot of work.
Copy linkTweet thisAlerts:
@ne_plus_ultraauthorNov 12.2007 — All very good suggestions. Thanks so much - I will try and let you know.
×

Success!

Help @ne_plus_ultra spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...