Forum Moderators: not2easy

Message Too Old, No Replies

Advertising Banner

Do I use CSS?

         

Jeigh

5:45 am on Jan 28, 2007 (gmt 0)

10+ Year Member



I'm relatively new to CSS so I don't know all that much, how would I go about making somthing so I can change the advertising banner on every page at once.

Would I use a external style sheet? What code would I need to use?

Thanks :)

penders

4:33 pm on Jan 28, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I recon advertising banners would more often be delivered using a server-side script (PHP perhaps) and then any click-throughs would be monitored...

However, if you just want a static (advertising) banner on each page, then yes, you could use an external stylesheet. And this would be very easy to update.

On your HTML page(s), create a <DIV> that contains your ad-banner:

<div id="adbanner1"></div>

And then, in your external CSS file you could set the dimensions for your banner and the background-image:

#adbanner1 { 
width:300px;
height:100px;
background:#000 url("banners/advert1.jpg") no-repeat;
}

Just to note... "banners/advert1.jpg" is a path relative to your CSS file, not your HTML file. And... background images are not printed (by default).

Jeigh

11:39 pm on Jan 28, 2007 (gmt 0)

10+ Year Member



Thankyou very much :D

That helps a lot.

martinship

3:33 am on Jan 29, 2007 (gmt 0)

10+ Year Member



how would I go about making somthing so I can change the advertising banner on every page at once

If you want to change the style of banner display, DIVs and even img tag styling are right up your alley. You can give the banner a border, or change its placement on the page. But I've learned my lesson on using CSS to call in content. Thanks to penders for answering the question, but I should point out there are a lot of non-CSS ways to do what you want.

1. Give the ad graphic called in the HTML a generic name and simply replace the graphic on the server. For example: upload a new ad with the same filename every month.

2. Use server-side includes. You can create a small HTML file with an IMG tag that calls the ad and have it included in other pages. Google if you're interested.

3. Use an ad manager written in interpreted language + database to give you a full-fledged solution.

penders

11:36 pm on Jan 29, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



martinship: Ha, yeah of course, it must be the CSS breeze whistling through my ears to overlook the simplicitly of [1]! :)