Page 1 of 1
Positioning Absolute to Right
Posted: Tue Feb 21, 2006 12:32 pm
by nickman013
Hello,
Ive just got google ads on my website. I would like to position them so they are always on the right, they are in their own div so It will be easy to identify. How would I do this with CSS ? I know, this is a simple question but I have been looking all over the place.
Thanks!
Posted: Tue Feb 21, 2006 12:35 pm
by feyd
the "float" attribute is used for this.
Posted: Tue Feb 21, 2006 12:37 pm
by nickman013
I know, I tried it but It went under my page content. I want it to be like frames, but I dont want to use frames, or tables.
Posted: Tue Feb 21, 2006 12:38 pm
by nickman013
nevermind, i spelled float wrong
Thanks!
Posted: Tue Feb 21, 2006 2:53 pm
by s.dot
if it appears under your content, set the z-index property higher than other elements z-index (if any)
Posted: Tue Feb 21, 2006 10:21 pm
by nickman013
How would I make text that runs into the ad wrap? In this book I have it shows the example of the float attribute and it says the text wraps around it.
thought this might be useful
Code: Select all
<style type=text/css>
#ads {
float:right;
}
#contents {
background-color:#4682B4;
border-color:white;
border-width:2px;
border-style:solid;
}
<style>
<div id=ads>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<br><br>
<div align=center id=contents>
<!--PAGE CONTENT BEGINS HERE-->
PAGE CONTENT IS IN HERE
<!--PAGE CONTENT ENDS HERE-->
</div>
Thanks!
Posted: Wed Feb 22, 2006 2:39 am
by matthijs
How would I make text that runs into the ad wrap?
You
want the text to run through the ad wrap??
Posted: Wed Feb 22, 2006 12:08 pm
by nickman013
I want it to <br>(break) at the ad.
Posted: Wed Feb 22, 2006 1:21 pm
by matthijs
A float must always be given a width. Either in pixels (for the ads the best I guess) or in ems or %.
That might/should help. If not, post your complete code here so I can check it out.