Ich werd noch wahnsinig!!!!!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ich werd noch wahnsinig!!!!!

    Hallo, also ich habe ein Menü, das wenn ich z.B. auf At Work klicke sich die Farbe ändert und die Schrift (Fett). Das soll bei jedem Menüpunkt so sein.
    Da ich nicht immer ein neues Menü machen möchte für die jeweilige Seite, wollte ich dann ne Abfrage machen! Ich Habe schon vieles Versucht aber nichts hat funktioniert!!
    Hier der Code:
    Code:
    <html>
    <head>
    <link rel="stylesheet" type="text/css" href="css/schrift_fett.css">
    <link rel="stylesheet" type="text/css" href="css/schrift_standard.css">
    <link href="css/link.css" rel="stylesheet" media="screen">
    </head>
    <body leftmargin="0" marginheight="0" marginwidth="0" topmargin="0">
    <table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td rowspan="3" width="15">
    </td>
    <td colspan="17" bgcolor="#000000" height="1">
    </td>
    <td bgcolor="#000000">
    </td>
    </tr>
    <tr>
    <td bgcolor="#000000" width="1">
    </td>
    <td height="20" bgcolor="#FF9900">
    <span class="schrift_fett">
    &nbsp;&nbsp;Aktuelles&nbsp;&nbsp;
    </span>
    </td>
    
    <td bgcolor="#000000" width="1">
    </td>
    
    <td height="20" bgcolor="#cccccc">&nbsp;&nbsp;
    <a href="seiten/atwork/index.php">
    At Work
    </a>
    &nbsp;&nbsp;
    </td>
    
    
    <td bgcolor="#000000" width="1">
    </td>
    
    <td height="20" bgcolor="#cccccc">
    <span class="schrift_standard">
    <a href="seiten/service/index.php">
    &nbsp;&nbsp;Service&nbsp;&nbsp;
    </a>
    </span>
    </td>
    <td bgcolor="#000000" width="1">
    </td>
    
    
    <td height="20" bgcolor="#cccccc">
    <span class="schrift_standard">
    <a href="../../seiten/downloads/index.php">
    &nbsp;&nbsp;Webworkerkurse&nbsp;&nbsp;
    </a></span>
    </td>
    <td bgcolor="#000000" width="1">
    </td>
    
    <td height="20" bgcolor="#cccccc">
    <span class="schrift_standard">
    &nbsp;&nbsp;Forum&nbsp;&nbsp;
    </span>
    </td>
    
    <td bgcolor="#000000" width="1">
    </td>
    <td height="20" bgcolor="#cccccc">
    <span class="schrift_standard">
    <a href="seiten/downloads/index.php">
    &nbsp;&nbsp;Downloads&nbsp;&nbsp;
    </a></span>
    </td>
    
    <td bgcolor="#000000" width="1">
    </td>
    <td height="20" bgcolor="#cccccc">
    <span class="schrift_standard">
    <a href="seiten/links/index.php">
    &nbsp;&nbsp;Links&nbsp;&nbsp;
    </a></span>
    </td>
    
    <td bgcolor="#000000" width="1">
    </td>
    <td height="20" bgcolor="#cccccc">
    <span class="schrift_standard">
    <a href="seiten/intern/index.php">
    &nbsp;&nbsp;Intern&nbsp;&nbsp;
    </a></span>
    </td>
    
    <td bgcolor="#000000" width="1">
    </td>
    <td height="20" bgcolor="#cccccc">
    <span class="schrift_standard">
    <a href="seiten/impressum/index.php">
    &nbsp;&nbsp;Impressum&nbsp;&nbsp;
    </a></span>
    </td>
    
    <td bgcolor="#000000" width="1">
    </td>
    </tr>
    
    
    <tr>
    <td colspan="17" bgcolor="#000000" height="1">
    </td>
    <td bgcolor="#000000">
    </td>
    </tr>
    </table>
    </body>
    </html>
    Man müsste dann da wo die Schrift definiert wird <span class="schrift_standard"> immer eine Abfrage rein machen, auch wo die farbe definiert wird. Wie könnte ich das machen? Könnte es mir einer anhand meines Beispiels zeigen?
    Mfg
    BenBay

  • #2
    Machs anders:

    mehrere externe Stylesheets:
    At work
    At home
    ... (was du auch immer brauchst)

    dann machst du am anfang:

    echo "<style>
    <link rel=$_GET[stylesheet].css> //habs grad nicht im Kopf
    </style>";

    Aufruf der Seite:

    index.php?stylesheet=atwork

    Comment


    • #3
      Habs jetzt so, das klappt aber auch nicht! Vielleicht habe ich das CSS falsch eingebunden oder so? Sieht jemand einen Fehler? Das CSS heist fett!
      Code:
      <html>
      <head>
      <link rel="stylesheet" type="text/css" href="$_GET[stylesheet].css">
      <link href="link.css" rel="stylesheet" media="screen">
      </head>
      <body leftmargin="0" marginheight="0" marginwidth="0" topmargin="0">
      <table border="0" cellspacing="0" cellpadding="0">
      <tr>
      <td rowspan="3" width="15">
      </td>
      <td colspan="17" bgcolor="#000000" height="1">
      </td>
      <td bgcolor="#000000">
      </td>
      </tr>
      <tr>
      <td bgcolor="#000000" width="1">
      </td>
      <td height="20" bgcolor="#FF9900">
      <span class="fett">
      <a href="index.php?stylesheet=fett">
      &nbsp;&nbsp;Aktuelles&nbsp;&nbsp;
      </a></span>
      </td>
      
      <td bgcolor="#000000" width="1">
      </td>
      
      <td height="20" bgcolor="#cccccc">&nbsp;&nbsp;
      <span class="fett">
      <a href="index.php?stylesheet=fett">
      At Work
      </a></span>
      &nbsp;&nbsp;
      </td>
      
      
      <td bgcolor="#000000" width="1">
      </td>
      
      <td height="20" bgcolor="#cccccc">
      <span class="fett">
      <a href="index.php?stylesheet=fett">
      &nbsp;&nbsp;Service&nbsp;&nbsp;
      </a>
      </span>
      </td>
      <td bgcolor="#000000" width="1">
      </td>
      <td height="20" bgcolor="#cccccc">
      <span class="fett">
      <a href="index.php?stylesheet=fett">
      &nbsp;&nbsp;Webworkerkurse&nbsp;&nbsp;
      </a></span>
      </td>
      <td bgcolor="#000000" width="1">
      </td>
      <td height="20" bgcolor="#cccccc">
      <span class="fett">
      <a href="index.php?stylesheet=fett">
      &nbsp;&nbsp;Forum&nbsp;&nbsp;
      </a></span>
      </td>
      <td bgcolor="#000000" width="1">
      </td>
      <td height="20" bgcolor="#cccccc">
      <span class="fett">
      <a href="index.php?stylesheet=fett">
      &nbsp;&nbsp;Downloads&nbsp;&nbsp;
      </a></span>
      </td>
      <td bgcolor="#000000" width="1">
      </td>
      <td height="20" bgcolor="#cccccc">
      <span class="fett">
      <a href="index.php?stylesheet=fett">
      &nbsp;&nbsp;Links&nbsp;&nbsp;
      </a></span>
      </td>
      <td bgcolor="#000000" width="1">
      </td>
      <td height="20" bgcolor="#cccccc">
      <span class="fett">
      <a href="index.php?stylesheet=fett">
      &nbsp;&nbsp;Intern&nbsp;&nbsp;
      </a></span>
      </td>
      <td bgcolor="#000000" width="1">
      </td>
      <td height="20" bgcolor="#cccccc">
      <span class="fett">
      <a href="index.php?stylesheet=fett">
      &nbsp;&nbsp;Impressum&nbsp;&nbsp;
      </a></span>
      </td>
      <td bgcolor="#000000" width="1">
      </td>
      </tr>
      <tr>
      <td colspan="17" bgcolor="#000000" height="1">
      </td>
      <td bgcolor="#000000">
      </td>
      </tr>
      </table>
      </body>
      </html>
      Mfg
      BenBay

      Comment


      • #4
        Die Datei muss die Endung php haben
        PHP Code:
        <link rel="stylesheet" type="text/css" href="<?php echo $_GET[stylesheet?>.css">

        Comment

        Working...
        X