• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Place an ad-banner outside the container?


I'm looking for a way to add floating ads outside the xenforo container, and make them be "included in the max page width". So for example, I have max-width 1270 so in 1980x1080 the ad would be placed at like 70% of the width. But if I would shrink my window, the page would automatically adapt to make both xenforo and the ads 100% of the browser window.

Like this:
A huge thanks in advance if anyone could help me with what to insert where. :)


My guess is to find page_container template, and inside it find

<div id="content" class="{$contentTemplate}">

if i remember correctly, sorry if i am wrong.

And below it add a new div:

<div style="float:right; margin: 6px"><a href="#"><img border="0" src="" alt="" width="60" height="640" /></a></div>

and see if that works?

this might push things around, perhaps you need to wrap this id=content div around a new container, so things stay in place.

<div id="pageContainer">

<div for ads here which floats right>
a link with img
</div> end ads one here

<div for content here>
</div> end content one here

</div> end pageContainer one here
Thanks alot for your tip! It works almost as I'd hoped, except two things.

1. With the above code the ad is is located at the far right, so on 1920x1080px there is a big gap between the container and the ad.

2. When the window is shrunken the ad is about 30px into the sidebar of xenforo, so the sidebar is pushed down below the ad.

Any ideas? :)