Layout ohne Tabellen

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • #16
    So nach langer langer Zeit habe ich es gerafft und gefunden und es funktioniert.

    bin jetzt dabei meine ganzen Seiten neu zu machen. Die Frage ist es sinnvoll, die einzelnen Elemente in einzelne Dateien zu schrieben udn dann zu includen?

    Sprich z.B. mein Menu.php zu includen und meine anderen auch. oder doch alles in eine Datei zu schrieben?

    Momentan habe ich es so gemacht.

    index.php
    PHP-Code:
    <?php
    include("phps/top.php");
    ?>
    <div id="text">
    <h2>
    MINI-GL
    </h2>
    <h4>
    Was ist die Mini Gl, was machen wir und wer ist dabei?
    </h4>
    <p style="text-align:justify;">
    Text    
    </p>
    </div>
    <?php
    include("phps/bottom.php");
    ?>
    meine top.php
    PHP-Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <link rel="stylesheet" type="text/css" href="style.css">
    <title>Ministranten St.Vitus Kriftel</title>
    </head>
    <body>
        <div id="top"></div>
        <div id="inhalt">
            <?php
            
    include ("menu.php");
            
    ?>
    meine menu.php
    PHP-Code:
    <div id="menu">
            <?php 
                error_reporting
    (E_ALL);
                include(
    "phps/dbconnect.php");
                
    $i 1;
                while (
    $i <= 3)
                {
                    
    ?>
                    <img src="img/menu/menu_<?php echo $i?>_1.jpg" alt="menu_<?php echo $i?>_1"><img src="img/menu/menu_<?php echo $i?>_2.jpg" alt="menu_<?php echo $i?>_2"><img src="img/menu/menu_<?php echo $i?>_3.jpg" alt="menu_<?php echo $i?>_3">
                    <div id="rollovermenu">  
                    <?php
                    $sql 
    "SELECT * FROM `menu_buttons` WHERE `gruppe` = $i";
                    
    $result mysql_query($sql,$dbconnect) or die ("Fehler in SQL : $sql");
                    while (
    $row mysql_fetch_array($resultMYSQL_NUM)) 
                    {
                        
    ?>
                        <a href="<?php echo $row[3]; ?>"><?php echo $row[1]; ?></a>
                        <?php
                    
    }
                    
    ?>
                    </div>
                    <?php
                    $i
    ++;
                }
                
    ?>
                <div style="background-image:url(img/menu/menu_impressum_1.jpg); width:11px; height:34px; float:left;">
                    <img src="img/menu/impressum_front_1.jpg" alt="impressum_front_1.jpg">
                </div>
                <div style="background-image:url(img/menu/menu_impressum_2.jpg); width:104px; height:34px; float:left;">
                    <img src="img/menu/impressum_front_2.jpg" alt="impressum_front_2.jpg"><img src="img/menu/impressum_front_3.jpg" alt="impressum_front_3.jpg">
                </div>
                <div style="background-image:url(img/menu/menu_impressum_3.jpg); width:31px; height:34px; float:right;"></div>
                <div style="clear:left;"></div>
            </div>
    meine bottom.php
    PHP-Code:
    <?php
    include("latest.php");
    ?>
    <div id="clear"></div>
        </div>
        <div id="bottom">
            <div id="stats"></div>
        </div>
    </body>
    </html>
    meine latest.php
    PHP-Code:
    <div id="latest">
                <?php
                $sql 
    "SELECT * FROM `news` ORDER BY `date` DESC";
                
    $result mysql_query($sql,$dbconnect) or die ("Fehler in SQL : $sql");
                
    $i=0;
                
    ?>
                <div id="latest_news">
                <ul>
                    <?php
                    
    while ($row mysql_fetch_array($resultMYSQL_NUM))
                    {
                        
    $anzahl_zeichen 16;
                        
    $laenge strlen($row[2]);
                        
    $row[2] = substr($row[2], 0$anzahl_zeichen);
                        if (
    $laenge >= $anzahl_zeichen)
                        {
                            
    $row[2] = $row[2]."...";
                        }
                        
    $date date("d.m.Y",$row[1]);
                        
    $time date("H:i",$row[1]);
                        
    $monthdate("m"$row[1]);
                        
    $year date("Y"$row[1]);
                        
    $i++;
                        
    ?>
                        <li>
                            <a href = "news.php?month=<?php echo $month;?>&year=<?php echo $year;?>&active=latest"><?php echo $date." ".$time;?> - <b><?php echo $row[2];?></b></a>
                        </li>
                        <?php    
                        
    if ($i == 4)
                        {
                            break;
                        }
                    }
                    
    ?>
                </ul>
                </div>
            </div>

    hier meine style.css
    PHP-Code:
    /* CSS Document */
    html{

    padding0px;
    margin0px;
    text-align:center;
    height:100%;
    }

    body {
    font-family:VerdanaArialHelveticasans-serif;
    font-size9px;
    color:#000000;
    }

    #top {

    text-align:left;
    width800px;
    height122px;
    margin0px auto;
    margin-top10px;
    background-imageurl(img/layout/top.jpg);
    }

    #inhalt {

    text-align:left;
    width800px;
    min-height600px;
    margin0px auto;
    background-imageurl(img/layout/inhalt.jpg);
    background-repeat:repeat-y;
    }

    #bottom {
    text-align:left;
    width800px;
    height:67px;
    margin0px auto;
    background-imageurl(img/layout/bottom.jpg);
    background-repeat:no-repeat;
    }

    #menu {
    text-align:left;
    floatleft;
    width146px;
    }

    #text {
    text-align:left;
    floatleft;
    width429px;
    margin-left10px;
    margin-top5px;
    }

    #latest {
    text-align:left;
    float:right;
    width207px;
    height:111px;
    background-imageurl(img/layout/latest.jpg);
    background-repeat:no-repeat;

    }

    #clear {
    clear:left;
    }

    #stats {
    text-alignleft;
    width146px;
    height67px;
    background-imageurl(img/layout/stats.jpg);
    background-repeat:no-repeat;
    }

    #rollovermenu {
    margin-top:0px;
    }

    #rollovermenu a{
    width:104px;
    height:18px;
    background-image:url(img/menu/button_blue.jpg);
    background-repeat:no-repeat;
    margin-left:11px;
    margin-top:-2px;
    padding-left:16px;
    padding-top:2px;
    text-decoration:none;
    font-family:Tahoma;
    font-size9px;
    color:#000000;
    display:block;
    }

    #rollovermenu a:hover{
    width:104px;
    height:18px;
    background-image:url(img/menu/button_orange.jpg);
    background-repeat:no-repeat;
    margin-left:11px;
    margin-top:-2px;
    padding-left:16px;
    padding-top:2px;
    text-decoration:none;
    font-family:Tahoma;
    font-size9px;
    color:#000000;
    display:block;
    }

    #latest_news {
        
    font-family:Tahoma;
        
    margin-top:35px;
        
    margin-left: -27px;
    }

    ul {
        list-
    style-typenone;
        
    line-height1.7;
    }

    {
    text-decoration:none;
    color:#000000;
    }

    {
    margin-top:0px;
    margin-left10px;
    margin-right10px;
    }

    h1 {
    font-family:VerdanaArialHelveticasans-serif;
    font-size:12px;
    }

    h2 {
    font-family:TahomaArialHelveticasans-serif;
    font-size:9px;
    border-bottom-colorblack;
    border-bottom-width1px;
    border-bottom-style:outset;
    margin-bottom9px;
    }

    h3 {
    font-family:TahomaArialHelveticasans-serif;
    font-size:9px;
    border-bottom-colorblack;
    border-bottom-width1px;
    border-bottom-style:outset;
    margin-bottom9px;
    margin-left5px;
    font-weight:normal;
    }

    h4 {
    font-weight:bold;
    font-family:VerdanaArialHelveticasans-serif;
    font-size:9px;
    margin-bottom5px;
    margin-top0px;
    margin-left10px;
    }

    input {
    font-size:8pt;
    font-family:Verdana;

    oder ist es wie gesagt sinnvoller alles in eine zu schreiben und das halt bei jeder Datei?

    Hoffe auf konstruktive Kritik zu Code und SInn auch wenn vieleicht alles total der größte Schrott ist.

    Grüße
    Jochen

    Kommentar

    Lädt...
    X