tags:

views:

147

answers:

2

Hello,

I have a Google ad placed to the right of a table. To do this, I am using CSS and making the table and ad items in a horizontal list. The code is below. It looks okay, but I would like to move the ad about 25 pixels down and 25 pixels to the right. How do I do this?

Thanks in advance,

John

Code:

if($sum>0){

print "<ul class='horizontal_list'>";
print "<li>";

print "<table class=\"navbarb\">\n";
print "<tr>";
print "<td class='sitenameb'>".'<a type="amzn" class="links2b">'.$entry.'</a>'."</td>";
print "</tr>\n";
print "</table>\n";

//echo "<p class=\"topic3\">".'<a href="http://'.$entry.'" class="links3">'.$entry.'</a>'. "</p>\n";
echo "<p class=\"topic4\">". number_format($sum) . ' votes in total.'."</p>\n";

arsort($votes); //reverse sort preserving keys


//print "<td class='sitename'>".'<a href="http://'.$row['site'].'" class="links2">'.$row['site'].'</a>'."</td>";



foreach ($votes as $table => $votes) {
  print "<table class=\"navbar1\">\n";
  print "<tr>";
  print "<td class='sitename1'>". $table .'</a>' ."</td>";
  print "<td class='sitename2'>". number_format($votes) ."</td>";
  print "</tr>\n";
  print "</table>\n";

print "</li>";  

}

?> 

<li>
<div class="googlead3">
<script type="text/javascript"><!--
google_ad_
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
</script>
</div>
</li>

Some of the CSS:

ul{
    margin: 0 auto;
}
ul.horizontal_list li{
    text-align: left;
    float: left;
    list-style: none;
    padding: 3px 10px 3px 10px;
    margin: 5px;`enter code here`
    border: 0px;
}   


    .googlead3
        { 
        float: right;
        margin-left:70px;
        margin-top:25px;
        margin-bottom:8px;
        padding:50px;
        }
+2  A: 

simplest is to make the ad position:relative (preserves layout) and make it top:25px and left: 25px

Luke Schafer
Can that be done in a horizontal list?
This can be done on any html element.
Gthompson83
A: 

Adding a 25px margin to the to and left should push it down.

Gthompson83
I tried that and it didn't work.