...

View Full Version : my site ads are in different areas depending on screen resolution



huntsman
11-25-2011, 04:20 AM
hey guys my website ads get displayed weird depending on the resolution. On my 23in 1080p they look fine but on my bros 1440x900 or something like that the banner ad get moved to the right a little. Is there anyway to keep the ads in place on all resolutions ? Any code for this.

Im using wordpress so i guess its html/css

If anyone could help me, id appreciate it. thanks. If you want to take a look at the site its www.kzkomputers.com

Excavator
11-25-2011, 08:36 AM
Hello huntsman,
Making the containing element position: relative; will make positioned elements inide it stay where you put them.
Add this bit in red -
.wrapper{
width:960px;
margin:0 auto;
position: relative;
}

Then adjust the position of your ad.

huntsman
11-26-2011, 04:11 AM
So all i have to add is position relative;

and thats it ?

Also where would i add it, I go into my header.php thats where the ad is located. Here is the script for my ad, or at least how it is now.

<div style="width:400px; height:100px; position:absolute; left:37%; margin-top:70px"><script type="text/javascript"><!--
google_ad_client = "ca-pub-7004674886429240";
/* lead */
google_ad_slot = "8298540578";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>

So now where would i add this position relative; ? Sorry if i sound dumb but i never messed around with css or html before. First time learning :)

Excavator
11-26-2011, 05:12 AM
So now where would i add this position relative; ? Sorry if i sound dumb but i never messed around with css or html before. First time learning :)


It looks fixed now. Did you figure it out?

StockDC2
11-26-2011, 10:43 AM
So all i have to add is position relative;

and thats it ?

Also where would i add it, I go into my header.php thats where the ad is located. Here is the script for my ad, or at least how it is now.

<div style="width:400px; height:100px; position:absolute; left:37%; margin-top:70px"><script type="text/javascript"><!--
google_ad_client = "ca-pub-7004674886429240";
/* lead */
google_ad_slot = "8298540578";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>

So now where would i add this position relative; ? Sorry if i sound dumb but i never messed around with css or html before. First time learning :)

Hello,

You would change the word "absolute" to "relative".

Btw, your code looks very confusing. The reason being that you have your style elements and javascript together with your HTML. The best way to create a page is to have your CSS code and Javascript code in separate files from your HTML file.

huntsman
11-26-2011, 09:05 PM
yes i managed to figure it out. Thank you guys.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum