Interview Questions

How to use CSS building a standards based HTML template?

CSS Interview Questions and Questions

(Continued from previous question...)

79. How to use CSS building a standards based HTML template?

It should:
1. Contain: header, navigation, content, footer
2. Use well-structured HTML
3. Be error-free and encourage good coding

Let’s start with number one there:

HTML document split up in four parts all with different meaning, use the

-tag. Div is short for “division” and isn’t header, navigation and so on ...

!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
   <meta http-equiv="Content-Type" 
   content="text/html; charset=ISO-8859-1">
   <title>Your own page title</title>
   <link rel="stylesheet" href="style.css" type="text/css">

<div id="header">
   <h1>The name of this page</h1>
<div id="navigation">
      <li><a href="first.html">First</a></li>
      <li><a href="second.html">Second</a></li>
      <li><a href="third.html">Third</a></li>
<div id="content">
   <p>Some sample content, add your own here</p>
<div id="footer">
   <p>This page is written by [Your name] and builds 
 n a <a href="">
 Friendlybit template</a>.</p>


body {
	background-color: Green;
div {
	border: 3px solid Black;
	padding: 7px;
	width: 600px;
h1, h2, h3, h4, h5, h6 {
	margin: 0;

#navigation {
	float: left;
	width: 150px;
#content {
	float: left;
	width: 430px;
#footer {
	clear: both;

(Continued on next question...)

Other Interview Questions