NameSilo

Absolute Positioning - Need Help Please...

Spaceship Spaceship
Watch

Richieboy67

Account Suspended
Impact
6
I have been using the following code to rotate banners in my header.. Of course firefox and maybe other browsers are not rendering the code for me and it is looking messed up... I have to fix this...


PHP:
<p style="position:relative;top:0px;right:25px"> 
$bannerads

 </p>


I guess the proper way would be to edit css..... Does anyone have the code for this or tips or anything?? I just want to place it in the right corner

here is my header template or someof it...

PHP:
<!-- begin surge header-->
<div align="center">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="border">
<tr>
  <td align="left" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
	<td width="221" height="113" rowspan="3"><img src="$stylevar[imgdir_misc]/surge_hdr_ls.gif" width="221" height="113" alt="" /></td>
	<td width="100%" height="113" rowspan="3" style="background-image: url($stylevar[imgdir_misc]/surge_hdr_x.gif)"><img src="$stylevar[imgdir_misc]/clear.gif" width="100%" height="1" alt="" /></td>
	<td width="531" height="77" colspan="7"><img src="$stylevar[imgdir_misc]/surge_hdr_top.gif" width="531" height="77" alt="" /></td></td>
  </tr>

  <tr>
	<td width="61" height="22"><a href="$vboptions[forumhome].php$session[sessionurl]"><img src="$stylevar[imgdir_misc]/surge_hdr_home.gif" width="61" height="22" border="0" alt="" /></a></td>
	<td width="81" height="22"><a href="usercp.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/surge_hdr_cp.gif" width="81" height="22" border="0" alt="" /></a></td>
	<if condition="$show['registerbutton']">
	<td width="83" height="22"><a href="register.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/surge_hdr_reg.gif"  width="83" height="22" border="0" alt="" /></a></td>
	<else />
	<td width="83" height="22" id="usercptools"><a href="#usercptools"><img src="$stylevar[imgdir_misc]/surge_hdr_links.gif"  width="83" height="22" border="0" alt="" /></a><script type="text/javascript"> vbmenu_register("usercptools" ,1); </script></td>
   </if>
	<td width="82" height="22"><a href="memberlist.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/surge_hdr_members.gif" width="82" height="22" border="0" alt="" /></a></td>
	<td width="89" height="22"><a href="calendar.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/surge_hdr_calendar.gif" width="89" height="22" border="0" alt="" /></a></td>
	<td width="74" height="22" id="navbar_search"><a href="search.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/surge_hdr_search.gif" width="74" height="22" border="0" alt="" /></a><script type="text/javascript"> vbmenu_register("navbar_search" ,1); </script></td>
	<td width="61" height="22"><a href="faq.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/surge_hdr_faq.gif" width="61" height="22" border="0" alt="" /></a></td>
  </tr>
  <tr>
	<td width="531" height="14" colspan="7"><img src="$stylevar[imgdir_misc]/surge_hdr_btm.gif" width="531" height="14" alt="" /></td>
	</tr>
</table>
<!-- end surge header-->

While I have your attention I am trying to come up with a conditional that stops certain browser such as firefox from seeing adsense in certain placements... Any tips or help would be awesome...

Thanks :)
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
i'm not even really sure what you're asking, but i have a feeling you want to use

position:absolute;

instead of position: relative;

take a look here: http://inoveryourhead.net

i use absolute positioning to place the search bar on the top right hand corner. should work the same for you. position:relative places the object in question on the right hand corner of whatever div it's in, instead of the top right hand corner, period.

let me know how it goes.
 
0
•••
I have figured this out finally using the following

PHP:
<style type="text/css"> 
<!-- 
#layer1 { 
    position:absolute; 
    width:460px; 
    height:60px; 
    z-index:1; 
    right: 80px; 
    top: 0px; 
} 
--> 
</style> 
<div id="layer1">$bannerads</div>

Of course the css can be used but this will be compliant either way and it will work with all browsers...
 
0
•••
Dynadot โ€” .com Registration $8.99Dynadot โ€” .com Registration $8.99
Appraise.net
Unstoppable Domains
Domain Recover
DomainEasy โ€” Live Options
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back