2009-07-09 8 views
0

Ich habe eine Google-Anzeige rechts neben einer Tabelle platziert. Dazu verwende ich CSS und mache die Tabellen- und Anzeigenelemente in einer horizontalen Liste. Der Code ist unten. Es sieht gut aus, aber ich möchte die Anzeige um 25 Pixel nach unten und 25 Pixel nach rechts verschieben. Wie mache ich das?CSS - Verschieben eines Objekts in eine horizontale Liste

Vielen Dank im Voraus,

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"> 
</script> 
</div> 
</li> 

Einige der 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; 
     } 

Antwort

2

einfachsten auf die Anzeigenposition zu machen ist: relative (bewahrt Layout) und mache es oben: 25px und links: 25px

+0

Kann das in einer horizontalen Liste gemacht werden? –

+0

Dies kann auf jedem HTML-Element erfolgen. – Gthompson83

0

Das Hinzufügen eines 25px-Rands zum To und Left sollte es nach unten drücken.

+0

Ich habe das versucht und es hat nicht funktioniert. –

Verwandte Themen