Soldato
- Joined
- 7 Mar 2005
- Posts
- 19,606
- Location
- LU7
I work for a local school and putting it bluntly the website is rather nasty and 90s-esque, not surprising considering I have to use Frontpage 2000 to maintain it. It uses frames which I find incredibly frustrating to manage when I need to add new pages to the menu list.
I've taken it upon myself to design a new website for the school using hand-coded XHTML and CSS so that the code is as concise as possible. To show what I mean, I was asked to re-write a page because a paragraph at the top of the page caused the a table immediately below it to shift to the right. I couldn't fix it without redoing the page. I re-did the page and once I'd finished the new page looked loads better. It was also a smaller page, being 12KB compared to its ancestor's 120KB or so. The number of surplus tags on every page is just ruddy ridiculous and means if I need to change a date or correct a typo I end up cross eyed and with a headache looking for the actual text I need in a haystack of tags.
I think at some point in the future I might be able to deploy a CMS, probably Wordpress as it'll be me doing the work so I hope I get a say in the CMS we'd use. Until then I want a new site that keeps the colours of the current site but does away with frames, surplus tags and has a nice dropdown menu so you can see what content is in a section of the site without having to actually enter that section of the site as people do now since we have a static menu. So over the last 2-3 weeks I've spent a few minutes a day just putting together something to show a colleague for his opinions and to form a base from which to implement a new site.
I've decided that since the menu links might change I want a menu that I can change once and have replicated on every page, for this reason I've chosen the PHP include() method/class. I've done the same with the footer so eventually the only part of each page that will be unique will be the actual content div. I've posted my XHTML and CSS code below so people can critique it/me, constructively I hope.
I'm not an expert on XHTML/CSS by any means but I can tell you that the look, layout, UI of this site is miles better than the current site.
I've also got some graphical glitches that I'd like to try and eliminate so the site looks as professional and clean as it possibly can considering my skills and talents.
In Opera the submenu items highlight align nicely with their parent li. For example, go to Clubs, Sport clubs, Netball. The highlight on hover align precisely. In Firefox and IE however the highlights for the submenu items are a few pixels down. I can correct this by changing:
to
Naturally by doing that the highlights don't align in Opera anymore. I just can't see what I'm doing wrong as I would have thought that Opera and Firefox would render the page nearly identically to each other not that Firefox and IE would look the same and different to Opera's rendering.
I have notice that if I mouse over the first item in any list the first item highlight has a few pixels of blue between it and the parent item. I think if I can get the two white highlights to touch here then Opera, Firefox and IE will be on the road to rendering identically. 
I've used the code from http://matthewjamestaylor.com/blog/keeping-footers-at-the-bottom-of-the-page to force the footer to the bottom of the page, no matter how much content there is. I was hoping the yellow of the content div would fill the whole of the page down to the footer. It doesn't. Any ideas why and can I fix it? I'm using the yellow as the pages on the school website were white and I was asked to find a colour that would liven the pages up. I found a nice yellow since the standard HTML yellow was too bright and overpowering. The yellow I'm using here is #ffe600 and I think it contrasts quite well with the dark blue, it certainly looks better than the dark blue and white which just looked too much like a boring company website. Since we are, in effect, a primary school we've decided that the #ffe600 yellow livens the site up a bit.
I might decide for the final site to have the whole page use #000033. I've used #000033 as that is the same blue on the school site and forms part of the school colours.
I hope people will agree that the XHTML is exquisitely coded as is possible.
I'm a bit OCD and I like my XHTML to be as sleek and lean as possible. The header, menu and footer divs are where I've used PHP include to import the generic menus. The content div is unique to each page. I've included the PHP code at the bottom of this post. If there are any improvements I can make to the PHP/XHTML code I'll gladly take them on board but I think that the CSS code is the weakest part of the site and I can probably tidy it up a lot before I deploy the site. The CSS is kind of the work in progress and so it can probably be pruned a fair bit once I've got a theme I'm happy with.
If anyone could also comment on how the site will scale on smaller resolution screens I'd love to hear from you. I made a website for a lecturer at Uni for my final year project about 2 years ago and this website is the first major site I've done since then. I've learned quite a bit since then, including the PHP include trick which could have said me about 8 years worth of work if I'd known about it when I was doing my final year project.
Apologies for the length of the post and all the code to read through. On the bright side though, once you've read this you'll have the stamina to read Tolkien's The Hobbit in one sitting!
I've use
CSS
PHP
I've taken it upon myself to design a new website for the school using hand-coded XHTML and CSS so that the code is as concise as possible. To show what I mean, I was asked to re-write a page because a paragraph at the top of the page caused the a table immediately below it to shift to the right. I couldn't fix it without redoing the page. I re-did the page and once I'd finished the new page looked loads better. It was also a smaller page, being 12KB compared to its ancestor's 120KB or so. The number of surplus tags on every page is just ruddy ridiculous and means if I need to change a date or correct a typo I end up cross eyed and with a headache looking for the actual text I need in a haystack of tags.
I think at some point in the future I might be able to deploy a CMS, probably Wordpress as it'll be me doing the work so I hope I get a say in the CMS we'd use. Until then I want a new site that keeps the colours of the current site but does away with frames, surplus tags and has a nice dropdown menu so you can see what content is in a section of the site without having to actually enter that section of the site as people do now since we have a static menu. So over the last 2-3 weeks I've spent a few minutes a day just putting together something to show a colleague for his opinions and to form a base from which to implement a new site.
I've decided that since the menu links might change I want a menu that I can change once and have replicated on every page, for this reason I've chosen the PHP include() method/class. I've done the same with the footer so eventually the only part of each page that will be unique will be the actual content div. I've posted my XHTML and CSS code below so people can critique it/me, constructively I hope.


I've also got some graphical glitches that I'd like to try and eliminate so the site looks as professional and clean as it possibly can considering my skills and talents.
In Opera the submenu items highlight align nicely with their parent li. For example, go to Clubs, Sport clubs, Netball. The highlight on hover align precisely. In Firefox and IE however the highlights for the submenu items are a few pixels down. I can correct this by changing:
Code:
#nav li ul ul {
margin: -26px 0 0 9em;
}
Code:
#nav li ul ul {
margin: -28px 0 0 9em;
}
Naturally by doing that the highlights don't align in Opera anymore. I just can't see what I'm doing wrong as I would have thought that Opera and Firefox would render the page nearly identically to each other not that Firefox and IE would look the same and different to Opera's rendering.


I've used the code from http://matthewjamestaylor.com/blog/keeping-footers-at-the-bottom-of-the-page to force the footer to the bottom of the page, no matter how much content there is. I was hoping the yellow of the content div would fill the whole of the page down to the footer. It doesn't. Any ideas why and can I fix it? I'm using the yellow as the pages on the school website were white and I was asked to find a colour that would liven the pages up. I found a nice yellow since the standard HTML yellow was too bright and overpowering. The yellow I'm using here is #ffe600 and I think it contrasts quite well with the dark blue, it certainly looks better than the dark blue and white which just looked too much like a boring company website. Since we are, in effect, a primary school we've decided that the #ffe600 yellow livens the site up a bit.

I hope people will agree that the XHTML is exquisitely coded as is possible.

If anyone could also comment on how the site will scale on smaller resolution screens I'd love to hear from you. I made a website for a lecturer at Uni for my final year project about 2 years ago and this website is the first major site I've done since then. I've learned quite a bit since then, including the PHP include trick which could have said me about 8 years worth of work if I'd known about it when I was doing my final year project.

Apologies for the length of the post and all the code to read through. On the bright side though, once you've read this you'll have the stamina to read Tolkien's The Hobbit in one sitting!

Code:
tags for the XHTML and CSS and [PHP] tags for the PHP code at the bottom. If people can think of better tags to use for the code, so it shows more of it, let me know and I'll make the changes.
[B][U]XHTML[/U][/B]
[code]
<?xml version="1.0"?>
<!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"
xml:lang="en">
<head>
<title>Overstone Combined School</title>
<link rel="stylesheet" type="text/css" href="default.css" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
</head>
<body>
<div id="wrapper">
<div id="header">
<p>Welcome to Overstone Combined School's website.<br/> The time is 10:13 PM and the date is Friday the 11th of December 2009.</p></div>
<div id="menu">
<ul id="nav">
<li><a href="#">About Us</a>
<ul>
<li><a href="#">The School</a></li>
<li><a href="#">Curriculum</a></li>
<li><a href="#">Nursery</a></li>
<li><a href="#">Infant</a></li>
<li><a href="#">Junior</a></li>
<li><a href="#">Results</a></li>
<li><a href="#">Homework</a></li>
<li><a href="#">Progress in Calculation</a></li>
<li><a href="#">Pupil destination</a></li>
<li><a href="#">OFSTED</a></li>
<li><a href="#">SEN</a></li>
</ul>
</li>
<li><a href="#">Clubs</a>
<ul>
<li><a href="#">After School Club</a>
<ul>
<li><a href="#">Registration form</a></li>
<li><a href="#">Newsletter</a></li>
<li><a href="#">Policy</a></li>
</ul>
</li>
<li><a href="#">Sport clubs</a>
<ul>
<li><a href="#">Netball</a></li>
<li><a href="#">Football</a></li>
</ul>
</li>
<li><a href="#">Musical clubs</a>
<ul>
<li><a href="#">Dance</a></li>
<li><a href="#">Music</a></li>
<li><a href="#">Choir</a></li>
<li><a href="#">Orchestra</a></li>
<li><a href="#">Recorders</a></li>
</ul>
</li>
<li><a href="#">Other clubs</a>
<ul>
<li><a href="#">Art</a></li>
<li><a href="#">Gardening</a></li>
<li><a href="#">Newspaper</a></li>
<li><a href="#">Library</a></li>
<li><a href="#">Shop</a></li>
<li><a href="#">Cookery</a></li>
<li><a href="#">Mind Bogglers</a></li>
<li><a href="#">Nature Detectives</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">Diary & Activities</a>
<ul>
<li><a href="#">Diary</a></li>
<li><a href="#">The School day</a></li>
<li><a href="#">PE & Games</a></li>
<li><a href="#">School trips</a></li>
<li><a href="#">Activity days</a></li>
<li><a href="#">Sporting fixtures</a></li>
</ul>
</li>
<li><a href="#">Healthy Schools</a>
<ul>
<li><a href="#">Walk to School</a></li>
<li><a href="#">Go for Gold</a></li>
<li><a href="#">Travel plan</a></li>
<li><a href="#">Energy</a></li>
<li><a href="#">Solar panels</a></li>
<li><a href="#">Solar water</a></li>
<li><a href="#">Healthy Breakfast</a></li>
<li><a href="#">JRSOs</a></li>
</ul>
</li>
<li><a href="#">Links & Contacts</a></li>
<li><a href="#">ParentMail</a></li>
<li><a href="#">PTA</a></li>
<li><a href="#">Pupils page</a></li>
<li><a href="#">School lunches</a></li>
<li><a href="#">Policies</a>
<ul>
<li><a href="#">Admissions</a></li>
<li><a href="#">Home/School agreement</a></li>
<li><a href="#">Attendance</a></li>
<li><a href="#">Rules & discipline</a></li>
<li><a href="#">Health</a></li>
<li><a href="#">Assessment</a></li>
<li><a href="#">Other policies</a>
<ul>
<li><a href="#">Physical activity</a></li>
<li><a href="#">Disability equality scheme</a></li>
<li><a href="#">Gender equality scheme</a></li>
<li><a href="#">Teaching & learning</a></li>
<li><a href="#">Inclusion policy</a></li>
<li><a href="#">Electronic equipment</a></li>
<li><a href="#">Uniform</a></li>
<li><a href="#">Jewellery</a></li>
<li><a href="#">Behaviour & anti-bullying</a></li>
<li><a href="#">Swimming</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">Staff & Governors</a>
<ul>
<li><a href="#">Teaching staff</a></li>
<li><a href="#">Staff</a></li>
<li><a href="#">Governors</a></li>
</ul>
</li>
</ul></div>
<div id="content">
<br/>
<h1>Hello</h1>
<p>This is our new website. We hope you like it! We've redesigned our site to keep the colours from the old site but with a new easier to use layout. Let us know what you think of the redesign.</p>
</div>
<div id="footer">
<p>This website uses valid XHTML & CSS.</p></div>
</div>
</body>
</html>
CSS
Code:
*, html, body, #nav li{
margin:0;
padding:0;
}
#wrapper {
min-height: 100%;
position: relative;
}
body{
font-family: Arial, Helvetica, sans-serif;
background-color: #000033;
}
#nav a {
line-height: 1;
}
#content {
padding-bottom: 60px; /* Height of the footer */
height: 100%;
}
#header h1, #header h2, #header h3, #header h4, #header h5, #header h6, #header p, #header a, #footer p, #nav a {
color: #fff;
}
#header {
border-bottom: 2px solid #fff;
margin-bottom: 5px;
}
#header p {
text-align: center;
margin: 5px 0;
}
#content {
clear: both;
background-color: #ffe600;
}
#content h1, #content h2, #content h3, #content h4, #content h5, #content h6, #content p, #content a {
margin: 0 5px;
}
#footer {
position: absolute;
bottom: 0;
width: 100%;
height: 60px;
}
#footer p {
text-align: center;
margin: 5px 0;
}
#nav{
font-size: 100%;
}
#nav a {
padding: 5px 0;
}
#menu {
width: 84%;
margin: auto;
}
#nav a {
display: block;
text-align: center;
text-decoration: none;
margin: 5px 0px;
}
#nav li {
background-color: #000033;
}
#nav a, #nav li, #nav li ul {
width: 9em;
}
#nav li {
float: left;
margin-top: -5px;
}
#nav li ul {
position: absolute;
left: -999em;
}
#nav li ul ul {
margin: -26px 0 0 9em;
}
#nav li:hover ul ul, #nav li.sfhover ul ul {
left: -999em;
}
#nav li:hover ul ul, #nav li:hover ul ul ul, #nav li.sfhover ul ul, #nav li.sfhover ul ul ul {
left: -999em;
}
#nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li.sfhover ul, #nav li li.sfhover ul, #nav li li li.sfhover ul {
left: auto;
}
#nav, #nav ul { /* all lists */
padding: 0;
margin: 0;
list-style: none;
}
#nav a:hover, #nav li:hover > a {
background-color: #fff;
color: #000033;
}
/* New stuff to keep footer at bottom of screen */
html,
body {
margin:0;
padding:0;
height:99%;
}
#wrapper {
min-height:99%;
position:relative;
}
#body {
padding: 10px;
padding-bottom: 20px; /* Height of the footer */
}
#footer {
position: absolute;
bottom: 0;
width: 100%;
height: 20px; /* Height of the footer */
/* border-top: 2px solid #fff; */
}
PHP
PHP:
<?xml version="1.0"?>
<!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"
xml:lang="en">
<head>
<title>Overstone Combined School</title>
<link rel="stylesheet" type="text/css" href="default.css" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
</head>
<body>
<div id="wrapper">
<div id="header">
<?php include("header.php");?>
</div>
<div id="menu">
<?php include("menu.php");?>
</div>
<div id="content">
<br/>
<h1>Hello</h1>
<p>This is our new website. We hope you like it! We've redesigned our site to keep the colours from the old site but with a new easier to use layout. Let us know what you think of the redesign.</p>
</div>
<div id="footer">
<?php include("footer.php");?>
</div>
</div>
</body>
</html>