Thread: Rusty CSS :-)
View Single Post
Old 11-21-2012, 07:17 PM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello bgareth,
You use absolute positioning without positioning anything. There is no real need for ap in this layout yet, it could work fine if you just let the document flow naturally instead.


Look at it like this -
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
html, body {
	height: 100%;
	font: 100% "Trebuchet MS", Arial, Helvetica, sans-serif;
	color: #000;
	background: #fff;
}
#column {
	height: 90%;
	width: 5%;
	float: left;
	background: #00f;
}
#container {
	width: 90%;
	margin: 0 0 0 5%;
	overflow: auto;
	background: #00f;
}
#content {
	margin: 5% 0 0;
	padding: 5%;
	background: #fff;
}
</style>
</head>
<body>
    	<div id="column"></div>
    <div id="container">
    	<div id="content">

<?php

/* Variable declarations */

$weekday = date("D");
$od = date("S");
$day = date("d");
$month = date("M");
$year = date("Y");
$hour = date("H");
$minute = date("i");
$seconds = date("s");

/* Multidimensional array for holidays - Christmas will be added later. */

$holidays = array( array("Boxing_Day", 2612),
					array("Easter_Monday", 0104),
					array("Good_Friday", 2903),
					array("January_2nd", 0201),
					array("May_Day_Holiday", 0605),
					array("New_Year's_Day", 0101),
					array("New_Year's_Eve", 3112),
					array("Orangeman's_Day", 1207),
					array("Saint_Patrick's_Day", 1703),
					array("Spring_Bank_Holiday", 2705),
					array("St_Andrew's_Day", 3011), 
					array("Summer_Bank_Holiday_Scotland", 0508),
					array("Summer_Bank_Holiday_ENIW", 2608),
             ); 

/* Display current time and date */

echo "<p>The time when you loaded this page was: {$hour}:{$minute}:{$seconds} GMT and the date was {$weekday}, {$day}{$od} {$month} {$year}.</p>
<p>I haven't learnt Javascript yet so I can't set it to auto-update without using meta-refresh.</p>";

/* To determine whether it is Christmas Eve the following day and if so to display a message after 7pm on 23 December. */

if ($day == 23 and $month == 12 and $hour > 19)
{
echo "<p>Christmas Eve is tomorrow.</p>";
}

/* To determine whether it is Christmas Day the following day and if so to display a message after 7pm on 24 December. */

elseif ($day == 24 and $month == 12 and $hour > 19)
{
echo "<p>Christmas Day is tomorrow.</p>";
}

/* Message to display if it is neither Christmas Eve or Christmas Day the following day. */

else 
{
echo "<h1>Today is not a holiday. Tomorrow isn't either.</h1>";
}

?>
        <!--end content--></div>
    <!--end container--></div>
</body>
</html>
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote