margin gaat verloren bij include
Ik heb een index.php bestand en een style.css bestand. Alles gaat goed. In <div> content heb ik met switch bestanden geincluded. Maar als ik dan vervolgens in localhost kijk, is mijn margin verloren gegaan. De rest van de css wordt wel overgenomen. Iemand een idee?
Groetjes
linda
Groetjes
linda
Misschien handig om je broncode te posten? (Alleen wat van toepassing is) Ik zou er graag naar kijken maar zonder code zou ik het zo niet weten...
Ik zal eerst mijn index.php tonen en daarna mijn style.css.
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!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=utf-8" />
<title>Tuinieren is mijn hobby | Linda Overkleeft</title>
<link href="includes/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">Welkom bij 'Tuinieren is mijn hobby'
</div>
<div id="container">
<div id="navi">
<a href="index.php?page=index">HOME</a>��������|������<a href="index.php?page=tuinieren">WAT IS TUINIEREN ANNO 2011?</a>��������
|��������<a href="gastenboek.php">GASTENBOEK</a>��������|��������<a href="index.php?page=contact">CONTACT</a>��������|��������<a href="index.php?page=wiebenik">WIE BEN IK?</a>
</div>
<div id="content" >
<?php
if(isset($_GET['page'])){
switch (strtolower($_GET['page']))
{
case "index":
$page="includes/index.php";
break;
case "tuinieren":
$page="tuinieren.php";
break;
case "contact":
$page="contact.php";
break;
case "wiebenik":
$page="wie.php";
break;
default:
$page="includes/default.txt";
break;
}
}
else $page = "includes/index.php";
include ($page);
?>
</div>
</div>
<div id="footer">COPYRIGHT LINDA OVERKLEEFT 2011 T.B.V. DE CURSUS PHP-MYSQL
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tuinieren is mijn hobby | Linda Overkleeft</title>
<link href="includes/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">Welkom bij 'Tuinieren is mijn hobby'
</div>
<div id="container">
<div id="navi">
<a href="index.php?page=index">HOME</a>��������|������<a href="index.php?page=tuinieren">WAT IS TUINIEREN ANNO 2011?</a>��������
|��������<a href="gastenboek.php">GASTENBOEK</a>��������|��������<a href="index.php?page=contact">CONTACT</a>��������|��������<a href="index.php?page=wiebenik">WIE BEN IK?</a>
</div>
<div id="content" >
<?php
if(isset($_GET['page'])){
switch (strtolower($_GET['page']))
{
case "index":
$page="includes/index.php";
break;
case "tuinieren":
$page="tuinieren.php";
break;
case "contact":
$page="contact.php";
break;
case "wiebenik":
$page="wie.php";
break;
default:
$page="includes/default.txt";
break;
}
}
else $page = "includes/index.php";
include ($page);
?>
</div>
</div>
<div id="footer">COPYRIGHT LINDA OVERKLEEFT 2011 T.B.V. DE CURSUS PHP-MYSQL
</div>
</body>
</html>
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@charset "utf-8";
/* CSS Document */
#header {
text-align:center;
font-family:"Hobo Std";
font-size:34px;
height: 60px;
width: auto;
background-color:#33FF99;
margin-right: auto;
margin-left: auto;
border-bottom-width: thick;
border-bottom-style: ridge;
border-bottom-color: #66FF33;
}
#container {
font-family: "Hobo Std";
height: auto;
width: auto;
background-color:#E6FAD1;
margin-right: auto;
margin-left: auto;
border-bottom-width: thick;
border-bottom-style: ridge;
border-bottom-color: #66FF33;
}
#navi {
text-align:center;
font-family: "Hobo Std";
font-size: 11px;
font-style: italic;
font-weight: lighter;
font-variant: small-caps;
height: 25px;
width: auto;
background-color:#FFFF66;
margin-right: auto;
margin-left: auto;
}
#footer {
text-align:center;
font-family: "Hobo Std";
font-size: 10px;
height: 25px;
width: auto;
background-color:#33ff99;
margin-right: auto;
margin-bottom: auto;
margin-left: auto;
}
#content {
background-color: #FFFFFF;
height: 500px;
width: 600px;
padding:10px;
text-align:center;
}
#contentgastenboek {
background-color: #FFFFFF;
height: auto;
width: 600px;
float:inherit;
padding:10px;
margin-right:auto;
margin-left:auto;
text-align:left;
}
TH {background-color:#ffff66;
text-align:right;
vertical-align:top;
font-size:10px}
/* CSS Document */
#header {
text-align:center;
font-family:"Hobo Std";
font-size:34px;
height: 60px;
width: auto;
background-color:#33FF99;
margin-right: auto;
margin-left: auto;
border-bottom-width: thick;
border-bottom-style: ridge;
border-bottom-color: #66FF33;
}
#container {
font-family: "Hobo Std";
height: auto;
width: auto;
background-color:#E6FAD1;
margin-right: auto;
margin-left: auto;
border-bottom-width: thick;
border-bottom-style: ridge;
border-bottom-color: #66FF33;
}
#navi {
text-align:center;
font-family: "Hobo Std";
font-size: 11px;
font-style: italic;
font-weight: lighter;
font-variant: small-caps;
height: 25px;
width: auto;
background-color:#FFFF66;
margin-right: auto;
margin-left: auto;
}
#footer {
text-align:center;
font-family: "Hobo Std";
font-size: 10px;
height: 25px;
width: auto;
background-color:#33ff99;
margin-right: auto;
margin-bottom: auto;
margin-left: auto;
}
#content {
background-color: #FFFFFF;
height: 500px;
width: 600px;
padding:10px;
text-align:center;
}
#contentgastenboek {
background-color: #FFFFFF;
height: auto;
width: 600px;
float:inherit;
padding:10px;
margin-right:auto;
margin-left:auto;
text-align:left;
}
TH {background-color:#ffff66;
text-align:right;
vertical-align:top;
font-size:10px}
Ten 1e kan het niet zo zijn dat margin niet word overgenomen wanneer je include gebruikt in PHP. Het zal (waarschijnlijk) ergens een foutje zijn waardoor een gedeelte van de CSS-code niet gelezen word. Zou je de "output" willen laten zien als code? (Dus wanneer je de pagina uitvoert en de broncode kopiert).
test
Toevoeging op 31/03/2011 20:00:26:
Het probleem doet zich voor in IE, niet in Firefox.. kan iemand daar iets mee?
broncode via localhost:
Toevoeging op 31/03/2011 20:00:26:
Het probleem doet zich voor in IE, niet in Firefox.. kan iemand daar iets mee?
broncode via localhost:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!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=utf-8" />
<title>Tuinieren is mijn hobby | Linda Overkleeft</title>
<link href="includes/style.css" rel="stylesheet" type="text/css" /><style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style></head>
<body>
<div id="header">Welkom bij 'Tuinieren is mijn hobby'</div>
<div id="container">
<div id="navi">
<a href="index.php?page=index">HOME</a>��������|������<a href="index.php?page=tuinieren">WAT IS TUINIEREN ANNO 2011?</a>��������
|��������<a href="gastenboek.php">GASTENBOEK</a>��������|��������<a href="index.php?page=contact">CONTACT</a>��������|��������<a href="index.php?page=wiebenik">WIE BEN IK?</a>
</div>
<div id="content" >
<H2> Welkom bij 'Tuinieren is mijn hobby'.</h2><p> Mijn hele leven zit ik eigenlijk al met mijn handen in de grond of aarde, net hoe je het wilt noemen.</p><p> Als kind zijnde hielp ik mijn vader in de tuin met de gerbera's en daarna lekker een onkruidje weghalen of grasmaaien, toen ik wat groter werd. Naarmate de jaren verstreken vond ik het steeds leuker worden. En toen mijn droom uitkwam, een eigen huisje met mijn vriend, kon ik heerlijk hobbyen in de tuin</p><p> Tuinieren is voor mij ook een rustpunt in de week of dag. Even nergens aan denken, geen php-codes ontleden of mailtjes beantwoorden, gewoon even simpel onkruid wieden of planten verpoten zodat je er daarna heerlijk van kunt genieten.</p> <img src="image/plant.gif" height="75" /><img src="image/tulp.gif" height="75" /><img src="image/plant.gif" height="75" /><img src="image/tulp.gif" height="75" /><img src="image/plant.gif" height="75" /><img src="image/tulp.gif" height="75" /><img src="image/plant.gif" height="75" /><img src="image/tulp.gif" height="75"/><img src="image/plant.gif" height="75" />
</div>
</div>
<div id="footer">COPYRIGHT LINDA OVERKLEEFT 2011 T.B.V. DE CURSUS PHP-MYSQL </div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tuinieren is mijn hobby | Linda Overkleeft</title>
<link href="includes/style.css" rel="stylesheet" type="text/css" /><style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style></head>
<body>
<div id="header">Welkom bij 'Tuinieren is mijn hobby'</div>
<div id="container">
<div id="navi">
<a href="index.php?page=index">HOME</a>��������|������<a href="index.php?page=tuinieren">WAT IS TUINIEREN ANNO 2011?</a>��������
|��������<a href="gastenboek.php">GASTENBOEK</a>��������|��������<a href="index.php?page=contact">CONTACT</a>��������|��������<a href="index.php?page=wiebenik">WIE BEN IK?</a>
</div>
<div id="content" >
<H2> Welkom bij 'Tuinieren is mijn hobby'.</h2><p> Mijn hele leven zit ik eigenlijk al met mijn handen in de grond of aarde, net hoe je het wilt noemen.</p><p> Als kind zijnde hielp ik mijn vader in de tuin met de gerbera's en daarna lekker een onkruidje weghalen of grasmaaien, toen ik wat groter werd. Naarmate de jaren verstreken vond ik het steeds leuker worden. En toen mijn droom uitkwam, een eigen huisje met mijn vriend, kon ik heerlijk hobbyen in de tuin</p><p> Tuinieren is voor mij ook een rustpunt in de week of dag. Even nergens aan denken, geen php-codes ontleden of mailtjes beantwoorden, gewoon even simpel onkruid wieden of planten verpoten zodat je er daarna heerlijk van kunt genieten.</p> <img src="image/plant.gif" height="75" /><img src="image/tulp.gif" height="75" /><img src="image/plant.gif" height="75" /><img src="image/tulp.gif" height="75" /><img src="image/plant.gif" height="75" /><img src="image/tulp.gif" height="75" /><img src="image/plant.gif" height="75" /><img src="image/tulp.gif" height="75"/><img src="image/plant.gif" height="75" />
</div>
</div>
<div id="footer">COPYRIGHT LINDA OVERKLEEFT 2011 T.B.V. DE CURSUS PHP-MYSQL </div>
</body>
</html>
Gewijzigd op 31/03/2011 19:58:50 door Linda Overkleeft
Welke versie van Internet Explorer gebruik je?
Welke css-code gebruik je voor de margin die wegvalt?
Bij mij doet je website het Prima (Firefox 4.0 & Internet Explorer 8).
Welke css-code gebruik je voor de margin die wegvalt?
Bij mij doet je website het Prima (Firefox 4.0 & Internet Explorer 8).
Nou ja zeg, ik start vandaag weer mijn huiswerk op en hij staat in het midden?! Zal wel een verschil in ie versies zijn ofzo... ben benieuwd of het nu goed blijft staan. Bedankt voor je hulp in ieder geval
Groetjes
Groetjes
Waarschijnlijk ligt het aan de cache van de browser. Zodra je op F5 drukt wordt de pagina op nieuw geladen, met de nieuwe bestanden.




