Sebastian G.: Div Container

Hallo,

ich habe eine Frage:

wie kann ich zwei Inhalte in einem Div nebeneinander ausrichten?

Ich habe Quellcode 1 (durch PHP erzeugt) und Quellcode 2(auch mit PHP erzeugt), die jetzt in einem div nebeneinander dargestellt werden sollen.

Wie aber geht das?

--------------------------
-                        -
-                        -

  • Inhalt 1     Inhalt 2  -
    -                        -
    -                        -
    -                        -
    --------------------------

Danke.

Sebastian

  1. Hallo.

    Du platzierst einfach zwei Elemente (etwa <div>s) nebeneinander. Siehe dazu das Beispiel für ein zweispaliges Layout: http://de.selfhtml.org/css/layouts/mehrspaltige.htm#zweispaltig

    Alternativ:
    http://de.selfhtml.org/css/eigenschaften/positionierung.htm

    Wodruch der (X)HTML-Code erzeugt wird, ist dem Browser ersteinmal egal. Hauptsache, er empfängt (validen) Code.

    MfG, Kungschu.

    --
    The computer is not willing? The bug is well hidden? The release is tomorrow?
    1. Hallo,

      das funktinoiert leider nicht.

      Ich habe diesen Code:

      <div>

      <table width='200'>
        <tr>
          <td class='LINK' height='40'>
          <a href='index.php?action=home'>Home</a>
          </td>
        </tr>
        <tr>
          <td class='LINK' height='40'>
          <a href='index.php?action=projekte'>Projekte</a>

      </td>
        </tr>
        <tr>
          <td class='LINK' height='40'>
          <a href='index.php?action=portfolio'>Portfolio</a>
          </td>
        </tr>
        <tr>

      <td class='LINK' height='40'>
          <a href='index.php?action=foren'>Foren</a>
          </td>
        </tr>
        <tr>
          <td class='LINK' height='40'>
          <a href='index.php?action=links'>Links</a>
          </td>

      </tr>
        <tr>
          <td class='LINK' height='40'>
          <a href='index.php?action=guestbook'>Gästebuch</a>
          </td>
        </tr>
        <tr>
          <td class='LINK' height='40'>

      <a href='index.php?action=impressum'>Impressum</a>
          </td>
        </tr>
      </table>

      </div><div width='600' valign='top'>

      <div class='CONTENT'>
        Home
      </div>

      </div>

      Weiß jemadn was falsch ist? Danke!

      1. Hallo.

        das funktinoiert leider nicht.

        Was? Wie sieht dein Ansatz aus?

        Dein Code zeigt im wesentlichen zwei <div>-Elemente, die mit Inhalt gefüllt sind (bzw. werden), der im Moment aber keine Rolle spielt. Dir geht es um deren Ausrichtung.
        div-Elemente sind Blockelemente und erzeugen somit "naturgemäß" einen neuen Absatz. Das Verhalten ist also völlig korrekt! Wie sieht denn .CONTENT aus? Du hast die Referenz zur Positionierung von Elementen beachtet?

        MfG, Kungschu.

        --
        The computer is not willing? The bug is well hidden? The release is tomorrow?