• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Bild neben tabelle

Blasc

Neues Mitglied
Hay leute würde gerne ein bild neben eine tabelle packen hab aber mein gesamtes wissen nur aus inet hilfen und hatte html/css das letzte mal vor 3-4 jahren in der schule, daher ist es sehr einfach und unübersichtlich
wollte gesamten content komplett zentiriert wiedergeben (horizontal und vertikal). Ungefähr das der ganze content in einem mittelgrossen viereck in der mitte des fensters zu finden ist. Dafür sollte "#center" sein wobei auch das nur horizontal klappt.
schicke euch ma einene "zensierten" quellcode

Meine Probleme:
-Das bild "bild3.jpg" welches eigtl. neben die tabelle sollte, wird einfach unter der tabelle angezeigt
-Wie bereits erwähnt funktioniert die zentrierung nur horizontal

Danke für alle antworten hoffe komme schnell auf ein ansehnliches Ergebnis!
lg Blasc
HTML:
<html>
        <head>
                <title>Titel</title>
                <link rel="shortcut icon" href="icon.ico"/>
        </head>
        <style type="text/css">
                body{
                        height:100%;
                        margin:0;
                        padding:0;
                }
                #center {
                        padding:0;
                        border:0px
                        width:448px;
                        min-height:298px;
                        top:50%;
                        left:50%;
                        margin:-150px 0 0 -225px;
                }
                #main {
                        float:left;

                }
                table.one {
                        float:left;
                        width:45%;
                        }

                table.two  {
                          width:45%;
                          float:right;
                        }


        </style>
        <body>

                <div id="#center">
                <div id="table.one">

        <table>
                <tr>
                        <img src="bild1.jpg" width="800" height="135">
                </tr>
                <tr>
                        <td>
                                <img src="bild2" alt="" float="left" border="0" width="440" height="27">
                        </td>


                </tr>
                <tr>
                        <td>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="name" placeholder="enter here" id="name" value="" />
                        </td>
                </tr>
                <tr>
                        <td>
                                <img src="bild2.jpg" alt="" border="0" width="440" height="50">
                        </td>
                </tr>
                <tr>
                        <td>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="name" placeholder="enter here" id="name2" value="" />
                        </td>
                </tr>
                <tr>
                        <td>
                                <br>
                                <h4>&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Text </h4>
                        </td>
                </tr>
                <tr>
                        <td>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="name" placeholder="enter here" id="name3" value="" />
                        </td>
                </tr>
                <tr>
                        <td>
                                <br>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="sub" value="    text      "    />
                        </td>
                </tr>

        </table>
        </div>
        <div id="table.two">
                              <img src="bild3.jpg" alt="" border="0" width="440" height="400">
        </div>

                </div>
        </body>
</html>
 
Dein HTML-Code ist nicht sauber, und Du hast ID und Klassen in CSS noch nicht wirklich verstanden.

Was ich damit meine?

In HTML verwendet man Tabellen nicht als Grundgerüst von Webseiten. Wenn Du Elemente nebeneinander haben willst, dann verwende dafür CSS, insbesondere die Eigenschaften float und margin helfen dabei.

Du hast z.B.

HTML:
<div id="#center">

geschrieben. Das ist falsch. In HTML musst Du

HTML:
<div id="center">

schreiben, in CSS dafür

Code:
#center { ... }

Siehe auch:
http://de.selfhtml.org/css/formate/zentrale.htm#klassen
 
Zurück
Oben