Forum Moderators: not2easy
While I can position the ads properly within one screen resolution (e.g., 1280) it will not maintain its position when the resolution is changed (e.g, 1024). I've used what I know about CSS positioning (e.g., absolute vs. relative, em instead of px) but without luck.
Is this possible to do without having to create conditionals based on screen resolution (e.g. if screen resolution is 1024 do this)?
Any guidance you can offer is greatly appreciated.
div#wrapper {
width:1000px;
margin:0 auto;
padding-top:200px; /*Change this according to the height of your adsense div, its purpose is to push down the rest of the page content to make room for adsense div*/
position:relative; /*needs to be relative so that absolutly positioned elements are placed correctly within it*/
}
div#adsense {
width:1000px;
height:200px;/*Change this according to the height of your adsense div*/
position:absolute;
top:0px; left:0px;
}
I think you would have to use javascript if you wanted to work out a site visitors screen size
I'm not sure if that helps, the above code is assuming you want the ad right at the top of the page
If you wanted it on the left say, use the same basic idea
div#wrapper {
width:800px;/*1000px - 200px padding*/
margin:0 auto;
padding-left:200px;
position:relative;
}
div#adsense {
width:200px;/*same as padding again*/
position:absolute;
top:0px; left:0px;
}
OK I hope that helps,
Or have I completly misunderstood the question?