PHP und CSS

Pacific

Grünschnabel
Folgendes Problem:

Ich habe zwei HTML / PHP Seiten. Die eine umfasst Links auf dunklem Hintergrund, die andere enthält Links auf hellem Hintergrund.

Da ich NICHT beiden Seiten die GLEICHE Linkfarbe gebrauchen kann, habe ich mir gedacht ich kreiere zwei Seiten und füge dann die eine mit PHP ein:

<?php
switch($action){
case "news": include("linksaufdunklemhintergrund.php"); break;
default: include("linksaufdunklemhintergrund.php"); break;
}
?>

Das blöde ist nur, es klappt nicht :(

Hat jemand von euch eine Idee wie ich das angehen könnte? FRAMES sind ausgeschlossen, IFrames auch ........

Grüsse aus der schönen Schweiz ;-)
 
Ich würde es folgendermassen machen:

PHP:
<?php 
if ($action == "news") { 
$Site = "linksaufdunklemhintergrund.php";
}
else {
$Site = "linksaufdunklemhintergrund.php";
} 
include("$Site"); 
?>

Slater (Aus dem schönen Emmental (CH) *g*)
 
Danke für den Tip.
Das ändert jedoch an der Sache nichts.
Ich kann nicht auf der "Hauptseite" die Links z.B. weiss färben und auf der integrierten Seite (mit dem Code) die Links schwarz fären .... :(
 
Das ist die Hauptseite (die Seite in welche die andere Seite integriert werden soll)


<html>

<head><TITLE> xxxx </TITLE>
<link rel="stylesheet" href="stylehaupt.css" type="text/css">
</head>

<body bgcolor="#d3dcff" name="hauptframe" leftmargin="0" marginwidth="0" topmargin="8" marginheight="8" >
<div align="center">
<?php
if ($action == "news") {
$Site = "haupt.php";
}
else {
$Site = "haupt.php";
}
include("$Site");
?><font> ..........



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


Das ist die Seite die integriert wird:

html>

<head>
<TITLE> xxxx </TITLE>
<link rel="stylesheet" href="style.css" type="text/css">
</head>

<body bgcolor="#d3dcff" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0">
<tr height="123">
<td width="759" height="123" background="oben1.jpg">
<table border="0" cellpadding="0" cellspacing="6">..........


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

Das ist CSS style.css

BODY {

scrollbar-face-color: #bec9e9;

scrollbar-shadow-color: #bec9e9;
scrollbar-highlight-color: #ffffff;
scrollbar-3dlight-color: #bec9e9;

scrollbar-arrow-color: #000000;
scrollbar-track-color: #D3DCFF;
}





font {
font-family : Geneva, Verdana, Tahoma, Arial;
font-size : 11px;
color : #000000;
}


.fontsmall {
font-family : Geneva, Verdana, Tahoma, Arial;
font-size : 3px;
color : #000000;
}


.fontsmallnewsletter {
font-family : Geneva, Verdana, Tahoma, Arial;
font-size : 6px;
color : #000000;
}


.fontfooter {
font-family : Geneva, Verdana, Tahoma, Arial;
font-size : 11px;
color : #000000;
}


.yellow {
font-family : Arial;
font-size : 12px;
color : #000000;
}


.fontlinks {
font-family : Geneva, Verdana, Tahoma, Arial;
font-size : 11px;
color : #ffffff;
}



.fontright {
font-family : Geneva, Verdana, Tahoma, Arial;
font-size : 11px;
color : #000000;
}


A:LINK {text-decoration: none; color:#ffffff}
A:VISITED {text-decoration: none; color:#ffffff}
A:ACTIVE {text-decoration: none; color:#ffffff}
a:hover {color:#000000;
}


.field1 {
border-width:1px; border-style:groove; border-color:#000000; background-color:#AFC2FA;
font-family : Geneva, Verdana, Tahoma, Arial;
font-size: 10px;
color: #000000;
scrollbar-face-color: #bec9e9;

scrollbar-shadow-color: #bec9e9;
scrollbar-highlight-color: #ffffff;
scrollbar-3dlight-color: #bec9e9;

scrollbar-arrow-color: #000000;
scrollbar-track-color: #D3DCFF;
}


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

Das ist CSS stylehaupt

BODY {

scrollbar-face-color: #bec9e9;

scrollbar-shadow-color: #bec9e9;
scrollbar-highlight-color: #ffffff;
scrollbar-3dlight-color: #bec9e9;

scrollbar-arrow-color: #000000;
scrollbar-track-color: #D3DCFF;
}





font {
font-family : Geneva, Verdana, Tahoma, Arial;
font-size : 11px;
color : #000000;
}


.fontsmall {
font-family : Geneva, Verdana, Tahoma, Arial;
font-size : 3px;
color : #000000;
}


.fontsmallnewsletter {
font-family : Geneva, Verdana, Tahoma, Arial;
font-size : 6px;
color : #000000;
}


.fontfooter {
font-family : Geneva, Verdana, Tahoma, Arial;
font-size : 11px;
color : #000000;
}

.flink {
font-family : Geneva, Verdana, Tahoma, Arial;
font-size : 11px;
color : #000000;
}


.yellow {
font-family : Arial;
font-size : 12px;
color : #000000;
}

A:LINK {text-decoration: none; color:#000000}
A:VISITED {text-decoration: none; color:#000000}
A:ACTIVE {text-decoration: none; color:#000000}
a:hover {color:#000000;
}

.fontright {
font-family : Geneva, Verdana, Tahoma, Arial;
font-size : 11px;
color : #000000;
}



.field1 {
border-width:1px; border-style:groove; border-color:#000000; background-color:#AFC2FA;
font-family : Geneva, Verdana, Tahoma, Arial;
font-size: 10px;
color: #000000;
scrollbar-face-color: #bec9e9;

scrollbar-shadow-color: #bec9e9;
scrollbar-highlight-color: #ffffff;
scrollbar-3dlight-color: #bec9e9;

scrollbar-arrow-color: #000000;
scrollbar-track-color: #D3DCFF;
}




Ist megacool dass ihr so helft
 
Du kannst es auch anders machen, mit nur einer css Datei.
Du weist den Links usw. im html als Parameter ein class zu z.b. class="content"

und im css z.b.:

a.content, a.content:visited, a.content:active { COLOR: #000000; FONT-SIZE: 10px; TEXT-DECORATION: none }
a.content:hover { text-decoration: underline; COLOR: #ffffff; FONT-SIZE: 10px; FONT-FAMILY: Verdana; }

War das das was du wolltest ? ;)
 
Zurück