Positioning Absolute to Right

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Positioning Absolute to Right

Post 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!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

the "float" attribute is used for this.
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post 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.
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

nevermind, i spelled float wrong :)

Thanks!
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

if it appears under your content, set the z-index property higher than other elements z-index (if any)
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post 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!
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

How would I make text that runs into the ad wrap?
You want the text to run through the ad wrap??
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

I want it to <br>(break) at the ad.
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

Code: Select all

#ads {
float:right;
}
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.
Post Reply