Lid |
|
Hallo
Ik weet niet niet goed in welk gedeelte van het forum in dit moet plaatsen. Aan de moderator om erover te beslissen. :-)
Ik ben een site aant ontwikkelen in php, waarbij ik gebruik maak van css voor de opmaak. daar ben ik al naarstig aan bezig. Nu de site bestaat uit twee delen: een header, een main en een rechter navigatiebar. In de header zit wel ook een navbar, maar die doet hier ff nie mee.
Om me het onderhoud later makkelijker te maken, dacht ik de header en de navbar te includen. Momenteel had ik voor iedere pagina code voor de header en de navigatiebar, vandaar dat ik me het vele werk wil besparen later via de include.
Nu komt mijn probleem. Mijn css bedraagt zich anders. zie maar:
site zonder include
site met include
Hoe komt dit? Beter nog hoe kan ik dit voorkomen?
code default.css:
/* CSS Document The Bigblue */
body{
position: absolute;
background-color:#000000}
font {color:#CCCCCC}
/* Header in een divje plaatsen */
#header {
margin-top: 10px;
margin-left: 50px;
width:750px;
height: 200px;
background-image: url(../../images/header.jpg);
background-repeat:no-repeat}
/* horizontale navigatiebar */
#navbar_horiz{
position:absolute;
margin-top: 160px;
margin-bottom: 0.5em;
width:750px;
}
#navbar_horiz ul {
background-color: silver;
text-align: center;
margin-left: 0;
padding-left: 0;
border-bottom: 1px solid gray;
}
#navbar_horiz li {
list-style-type: none;
padding: 0.5em 1.2em;
border-left: 1px solid white;
display: inline;
vertical-align:middle;
}
#navbar_horiz li:first-child {
border: none;
}
/* Rechtse navigatie bar*/
#navbar_right{
position:absolute;
background-color:#FFFFFF;
margin-left: 660px;
width: 145px;
height: 630px;
font-family:Verdana, Calibri, Cambria}
.navbar_top{
background: #1E5791;
height: 35px;
vertical-align:middle;
text-align: center;
text-decoration:underline;
font-family:Courier New, Courier, monospace;
color: #FFFFFF;
font-size:18px;
font-style:italic;
font-variant:small-caps;
border-width:2px;
border-color:#FFFFFF;
border-style:solid;
}
.li_navbar{
font-family:Verdana, Calibri, Cambria, Arial, Helvetica, sans-serif;
font-size:12px;
}
#main {
position:absolute;
background-color:#666666;
width: 600px;
margin-left: 50px;
height: 630px;
font-family: verdana, Calibri;
font-size:18pt;
}
/* CSS Document The Bigblue */ body{ position: absolute; background-color:#000000} font {color:#CCCCCC} /* Header in een divje plaatsen */ #header { margin-top: 10px; margin-left: 50px; width:750px; height: 200px; background-image: url(../../images/header.jpg); background-repeat:no-repeat} /* horizontale navigatiebar */ #navbar_horiz{ position:absolute; margin-top: 160px; margin-bottom: 0.5em; width:750px; } #navbar_horiz ul { background-color: silver; text-align: center; margin-left: 0; padding-left: 0; border-bottom: 1px solid gray; } #navbar_horiz li { list-style-type: none; padding: 0.5em 1.2em; border-left: 1px solid white; display: inline; vertical-align:middle; } #navbar_horiz li:first-child { border: none; } /* Rechtse navigatie bar*/ #navbar_right{ position:absolute; background-color:#FFFFFF; margin-left: 660px; width: 145px; height: 630px; font-family:Verdana, Calibri, Cambria} .navbar_top{ background: #1E5791; height: 35px; vertical-align:middle; text-align: center; text-decoration:underline; font-family:Courier New, Courier, monospace; color: #FFFFFF; font-size:18px; font-style:italic; font-variant:small-caps; border-width:2px; border-color:#FFFFFF; border-style:solid; } .li_navbar{ font-family:Verdana, Calibri, Cambria, Arial, Helvetica, sans-serif; font-size:12px; } #main { position:absolute; background-color:#666666; width: 600px; margin-left: 50px; height: 630px; font-family: verdana, Calibri; font-size:18pt; }
code main.php
<?php
include 'header.php';
include 'navbar_right.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="shortcut icoN" href="../../images/andi_europe.ico">
<title>The Big Blue New</title>
<link href="../../css/default.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="main"> main div </div>
</body>
</html>
<?php include 'header.php'; include 'navbar_right.php'; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="shortcut icoN" href="../../images/andi_europe.ico"> <title>The Big Blue New</title> <link href="../../css/default.css" rel="stylesheet" type="text/css"/> </head> <body> <div id="main"> main div </div> </body> </html>
code navbar_right.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="shortcut icoN" href="../../images/andi_europe.ico">
<title>The Big Blue New</title>
<link href="../../css/default.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="navbar_right">
<p class="navbar_top"> duikshop </p>
<ul>
<li class="li_navbar"> winkel </li>
<li class="li_navbar"> nieuws </li>
</ul>
<p class="navbar_top">rebreather</p>
<ul>
<li class="li_navbar"> rEvo </li>
<li class="li_navbar"> opleidingen </li>
</ul>
<p class="navbar_top"> login </p>
<Form method="post" action="login.php">
<p class="li_navbar">username:<br> <input type="text" name="username" width="150px">
<br> password: <br><input type="password" name="password" width="75%"></p>
<input type="submit" value="login" width="25px">
<input name="reset" type="reset" id="reset" value="reset" width = "25px">
</Form>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="shortcut icoN" href="../../images/andi_europe.ico"> <title>The Big Blue New</title> <link href="../../css/default.css" rel="stylesheet" type="text/css"/> </head> <body> <div id="navbar_right"> <p class="navbar_top"> duikshop </p> <ul> <li class="li_navbar"> winkel </li> <li class="li_navbar"> nieuws </li> </ul> <p class="navbar_top">rebreather</p> <ul> <li class="li_navbar"> rEvo </li> <li class="li_navbar"> opleidingen </li> </ul> <p class="navbar_top"> login </p> <Form method="post" action="login.php"> <p class="li_navbar">username:<br> <input type="text" name="username" width="150px"> <br> password: <br><input type="password" name="password" width="75%"></p> <input type="submit" value="login" width="25px"> <input name="reset" type="reset" id="reset" value="reset" width = "25px"> </Form> </div> </body> </html>
code header.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="shortcut icoN" href="images/andi_europe.ico">
<title>The Big Blue New</title>
<link href="../../css/default.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="header">
<div class="navbar_horiz">
<ul>
<li> Start </li>
<li> Noordzee </li>
<li> Duikshop </li>
<li> Duikschool </li>
<li> Gastenboek </li>
<li> leden toevoegen </li>
</ul>
</div>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="shortcut icoN" href="images/andi_europe.ico"> <title>The Big Blue New</title> <link href="../../css/default.css" rel="stylesheet" type="text/css"/> </head> <body> <div id="header"> <div class="navbar_horiz"> <ul> <li> Start </li> <li> Noordzee </li> <li> Duikshop </li> <li> Duikschool </li> <li> Gastenboek </li> <li> leden toevoegen </li> </ul> </div> </div> </body> </html>
|