1 (edited by mattkk 2007-07-14 15:07)

Topic: Multiple banners?

Well I have looked everywhere to find a code or something that will allow each style to have its own banner. For example:

oxygen = Banner1.jpg
lithium = Banner2.jpg

I can't find anything close to what I want.
It would be greatly appriciated if someone can hook me up with a code, or point me in the right direction to go about doing this, any help at all is worth alot to me.

Thanks.

Re: Multiple banners?

Edit the CSS for each style to have a different banner?

Re: Multiple banners?

are you talking about a logo img or a ad banner?


Q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Re: Multiple banners?

@Smartys: Hmm, how would I go about doing that, ie what code?
@Quaker: The logo img mate, i need it to be different on every style.

Thanks guys.

5

Re: Multiple banners?

The best way to do it is to get rid of the <img /> from your markup and then set a background image to the <a> tag in the stylesheets. That way you can use a different background image for each style without touching the code at all.

First I would add an ID to link something like <a id="mybanner"
I would then add a text link to the existing <a> tag to say something like "fourthSTREET Homepage" and then style the <a> something like this 

a#mybanner {
  display:block;
  font-size: 0;
  height: 0;
  line-height: 0;
  overflow: hidden;
  text-decoration: none;
  padding-top: 140px;
  background-image: url(whatever);
  background-repeat: no-repeat;
  background-position: top center;
  }

That also has the adavantage of getting rid of the invalid code you currently have and you can remove the pointless <center> tag.

Re: Multiple banners?

Thanks alot Paul, though there is just one problem, the banner shows up on the correct skin therefore it repeats itself about 4-5 times even though i have kept background-repeat on no-repeat.

If that doesn't make any sense, you can see it for yourself if you register at my site and choose "fourthpink skin". Any further advice would be greatly appriciated, Paul.

Re: Multiple banners?

A couple things I noticed.
1. Your <a> tag is invalid. The opening tag is missing a > and there's no closing tag/it's not self closed
2. You have this in your CSS

a#mybanner {
  display:block;
  font-size: 0;
  height: px;
  line-height: 0;
  overflow: none;
  text-decoration: none;
  padding-top: 125px;
  background-image: url(http://www.4th-street.net/Banner.png);
  background-repeat: no-repeat;
  background-position: top center;
  }

  a#mybanner {
    background: url(http://www.4th-street.net/Banner.png)center center no-repeat;
    height: 120px;
    margin: 0px;
}

The second bit isn't necessary, is it?

8

Re: Multiple banners?

You still have the <img> tag in your markup, get rid of it and replace it with a text link. Also, the height must be 0px not 120px.

Re: Multiple banners?

Ok silly question. Why no height? and using padding-top instead?

10

Re: Multiple banners?

Because content occupies the height of an element excluding padding but backgrounds also occupy the padding area. If you set the height to 0 and just have top padding equivelant to the height of the background image then the image is visible becuase it occupies the padding but the text is hidden. Its a technique used to make graphic links and banners accessible. Visually you get the graphic but somebody using a screen reader or viewing an unstyled page gets the text. Its also good for SEF because you have a real link not just an image. In PunBB's case the best way to do a banner would actually be to use the H1 and hide the text using this technique. That way the H1 is still there in the markup, you just can't see it. There are other ways to do it of course, you can put the content in a span and shift it off screen but this method doesn't involve any extra markup.

Re: Multiple banners?

Hey! Sorry to bring an old issue up but the banner still repeats itself in FireFox but not IE. My website is

http://www.megadeus.com/

It looks fine on my default skin, but when you register and switch it to a stock skin the banner repeats 5 times.