Nieuw lid |
|
Hallo allemaal, ik gebruik volgend css-bestand:
html
{
border-width: 0px;
}
body
{
margin: 0px;
padding: 0px;
font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: normal;
background-color: #dd2222;
color: #ffffff;
}
div#fixed
{
position: fixed;
}
img#header {
height: 200px;
width: 100%;
top: 0px;
left: 0px;
}
div#menu
{
position: fixed;
top: 230px;
left: 0px;
width: 100%;
height: 15px;
background-color: #eeeeee;
text-align: center;
}
div#menu a {
text-decoration: none;
width: 100px;
}
div#menu a:link {
color: #dd2222;
}
div#menu a:hover {
color: #ff0000;
font-weight: 900;
}
div#menu a:visited {
color: #dd2222;
}
div#menu a:active {
color: #ff0000
}
table#grand_table
{
position: fixed;
top: 200px;
left: 0px;
width:100%;
height: 30px;
background-color: #aa3333;
}
table#grand_table2
{
position: absolute;
top: 260px;
left: 5%;
width:90%;
background-color: #aa3333;
font-size: 11px;
}
tr#header
{
font-weight: bold;
font-size: 15px;
}
td {
border-width: 1px 0px 0px 0px;
vertical-align: top;
padding: 10px;
}
td#n
{
width: 15%;
}
td#b
{
width: 45%;
text-align: justify;
}
td#a
{
width: 25%;
}
td#p
{
width: 5%;
}
p, div, span {
font-size: 11px;
}
a,
a:link,
a:visited,
a:active,
a:hover
{
text-decoration: underline;
color: #ffffff;
}
a:hover
{
color: #55ff55;
}
html { border-width: 0px; } body { margin: 0px; padding: 0px; font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; background-color: #dd2222; color: #ffffff; } div#fixed { position: fixed; } img#header { height: 200px; width: 100%; top: 0px; left: 0px; } div#menu { position: fixed; top: 230px; left: 0px; width: 100%; height: 15px; background-color: #eeeeee; text-align: center; } div#menu a { text-decoration: none; width: 100px; } div#menu a:link { color: #dd2222; } div#menu a:hover { color: #ff0000; font-weight: 900; } div#menu a:visited { color: #dd2222; } div#menu a:active { color: #ff0000 } table#grand_table { position: fixed; top: 200px; left: 0px; width:100%; height: 30px; background-color: #aa3333; } table#grand_table2 { position: absolute; top: 260px; left: 5%; width:90%; background-color: #aa3333; font-size: 11px; } tr#header { font-weight: bold; font-size: 15px; } td { border-width: 1px 0px 0px 0px; vertical-align: top; padding: 10px; } td#n { width: 15%; } td#b { width: 45%; text-align: justify; } td#a { width: 25%; } td#p { width: 5%; } p, div, span { font-size: 11px; } a, a:link, a:visited, a:active, a:hover { text-decoration: underline; color: #ffffff; } a:hover { color: #55ff55; }
en de volgende html/php-code:
<html>
<head>
<title>Knome Electronics</title>
<link rel="stylesheet" href="css/style.css" type="text/css">
</head>
<body>
<div id="fixed"><img src="img/header.gif" id="header"></div>
<table id="grand_table">
<tr><td style="text-align: right"><a href="admin.php" target="_blank">admin</a></td></tr>
</table>
<?php
include("menu.php");
echo '<table id="grand_table2">';
echo '<tr id="header"><td id="n">Naam</td><td id="b">Beschrijving</td><td id="a">Afbeelding</td><td id="p">Prijs</td></tr>';
$db = mysql_connect("xxx","xxx", "xxx");
mysql_select_db("xxx",$db) or die ("Kan niet verbinden.");
$sql = "SELECT * FROM `artikel`";
$result = mysql_query($sql);
$rows = mysql_num_rows($result);
while ($row = mysql_fetch_array($result)) {
echo '<tr>';
echo '<td id="n">';
echo $row["naam"];
echo '</td><td id="b">';
echo $row["beschrijving"];
If (file_exists($row["afbeelding"])) {
echo '</td><td id="a"><img src="';
echo $row["afbeelding"];
echo '"></td><td id="p">';
} else {
echo '</td><td id="a">geen afbeelding</td><td id="p">';
}
echo $row["prijs"];
echo '</td>';
echo '</tr>';
}
?>
</table>
</body>
</html>
<html> <head> <title>Knome Electronics</title> <link rel="stylesheet" href="css/style.css" type="text/css"> </head> <body> <div id="fixed"><img src="img/header.gif" id="header"></div> <table id="grand_table"> <tr><td style="text-align: right"><a href="admin.php" target="_blank">admin</a></td></tr> </table> <?php include("menu.php"); echo '<table id="grand_table2">'; echo '<tr id="header"><td id="n">Naam</td><td id="b">Beschrijving</td><td id="a">Afbeelding</td><td id="p">Prijs</td></tr>'; $sql = "SELECT * FROM `artikel`"; echo $row["beschrijving"]; echo '</td><td id="a"><img src="'; echo '"></td><td id="p">'; } else { echo '</td><td id="a">geen afbeelding</td><td id="p">'; } } ?> </table> </body> </html>
Alles uit de code werkt, ik heb het css-bestand gecontroleerd met de W3C CSS Validator, 0 fouten, en toch werkt die fixed position bij div#fixed en div#menu niet... Het index.php-bestand is trouwens te zien op electronics.knome.nl.
Waarom werkt het niet??
Alvast bedankt.
EDIT: haha, , vergeten dat fixed in IE6, de browser die ik gebruik, niet werkt XD
|