Wie Text in div-Container mittig darstellen (ohne Tabellen)
Honig-Kuchen-Pferd
- css
Mir stellt sich folgendes Problem: Ich habe in einem div-Container links einen Schriftzug und rechts eine Grafik. Der Schriftzug soll mittig im Bezug zur Grafik sein. Kann ich mein Vorhaben ohne Tabellen verwirklichen, und wenn ja: wie?
+----------------div----------------------+
| |
| |
| +------+ |
| |Grafik| |
| Text Text Text |Grafik| |
| Text Text Text |Grafik| |
| |Grafik| |
| +------+ |
| |
| |
+----------------div----------------------+
Mein nicht ganz glücklicher Quellcode sieht so aus:
<div id="container">
<table border="0" width="100%">
<tr>
<td style="vertical-align:middle;">
<pre>Text Text</pre>
</td>
<td>
<img src="grafik.png" width="182" height="105" alt="grafik" style="float:right;" />
</td>
</tr>
</table>
</div>