FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Advertisement Placement

 


scotty
http://www.scott.frih.net/articles/

On my site I would like to place all advertisements down the left had side of the page, outside the main content column/pane.


I'd rather my visitors see the content of course if their resolution is not high enough and I'd like to get the ads out of my site, sort of disassociate them.

Is there any way to do this via CSS? I'm a noob Embarassed
LukeakaDanish
You could put your adverts inside

Code:
<div style="position: absolute; top: 0px; left: 0px; z-index: 1;">ADDS</div>


...then put that straight after the <body> tag.

Put everthing else inside

Code:
<div style="position: relative; top: 0; left: 0; z-index: 2;">CONTENT</div>


...this may screw up your design, depending on how your style sheet is written - otherwise you could try applying position relative and z-index: 2; to all other elements which are 1. level children of the <body> element.
aningbo
why dont people use tables instead of div. i dont really recommend using div.
coreymanshack
tables will keep your page proportianate even at different resoulutions and screen width/heights where as div's wont
LukeakaDanish
coreymanshack wrote:
tables will keep your page proportianate even at different resoulutions and screen width/heights where as div's wont


Correction: Divs will - if your not a css noob.

Quote:
why dont people use tables instead of div. i dont really recommend using div.


For this problem, tables would not only be harder to use, they would also be incapable of doing what is needed of them. HOW you would make the advert slide behind the content at low resolutions without position absolute?
scotty
LukeakaDanish wrote:
You could put your adverts inside

Code:
<div style="position: absolute; top: 0px; left: 0px; z-index: 1;">ADDS</div>


...then put that straight after the <body> tag.

Put everthing else inside

Code:
<div style="position: relative; top: 0; left: 0; z-index: 2;">CONTENT</div>


...this may screw up your design, depending on how your style sheet is written - otherwise you could try applying position relative and z-index: 2; to all other elements which are 1. level children of the <body> element.


Thanks for your help mate that sounds like exactly what I want! Do you know of a good site to learn CSS from?
LukeakaDanish
scotty wrote:
LukeakaDanish wrote:
You could put your adverts inside

Code:
<div style="position: absolute; top: 0px; left: 0px; z-index: 1;">ADDS</div>


...then put that straight after the <body> tag.

Put everthing else inside

Code:
<div style="position: relative; top: 0; left: 0; z-index: 2;">CONTENT</div>


...this may screw up your design, depending on how your style sheet is written - otherwise you could try applying position relative and z-index: 2; to all other elements which are 1. level children of the <body> element.


Thanks for your help mate that sounds like exactly what I want! Do you know of a good site to learn CSS from?


www.w3schools.com is always a good site for that kinda thing.

If you dont like that (its probably the best on the internet), I recomend buying a book.
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.