Photo of panda bear leaning against a treet truck eating bambo at the San Diego Zoo.
Photo by Aimee Wolff

Introduction to Web Development
Instructor: Bill Wolff
Spring 2006

  • home
  • syllabus
  • schedule
  • assignments
  • readings
large text style icon no style icon three column style icon right style icon left style icon

 

students

  • patrick bailey
  • anna dinh
  • stuart geiger
  • paige grisham
  • chad hebert
  • erica ho
  • daniel hoodin
  • i-chen huang
  • shane kerr
  • christopher kominczak
  • dona kurtz
  • lindsay lalonde
  • adam lafave
  • alfonso salinas
  • jessica scheick
  • erin selleck
  • mo sheikh
  • dwayne shorter
  • yvonne so
  • michael terrazas
  • clay thornton
  • jessica tremblay

project quicklinks

  • project 1 overview
  • project 1 groups
  • inventory and anaylsis
  • prototype
  • final redesign
  • blanton museum
  • web redesign
  • project 2 overview
  • professional site
  • portfolio
  • css journal
  • project 3 overview
  • project 3 groups

discussion

  • email the instructor
  • email the course list
  • discussion forum
  • learning record info

design

  • jeffrey zeldman
  • eric meyer
  • dan cederholm
  • dave shea
  • andy budd
  • stylegala
  • css beauty
  • brian fusco and akash goel
  • jakob neilson
  • joe clark
  • inform IT
  • a list apart
  • digital web magazine
  • ut's learning to publish
  • ut accessibility guidelines
  • w3c schools
  • css resource guide
  • web standards project

applications

  • bevoware
  • webspace
  • webmail
  • html-kit (for pc users)
  • taco (for mac users)
  • mozilla firefox
  • web developer toolbar
  • x-ray extension
  • email encoder
  • simplecode by simplebits
  • jaws (for pc users)
  • WebXACT
  • lift
  • css validator
  • xhtml validator

university

  • sci tech and society
  • cwrl
  • campus computer store
  • university of texas

Building a Basic CSS Layout

This short tutorial will show you how to create a basic but effective CSS layout, using an excellent open source online tool: InkNoise's Layout-o-Matic. Use this tool when creating your CSS-styled pages and you'll have very few browser compatability problems -- and the layout is flexible enough for you to adapt it to your more complex design needs.

  1. Create a new folder on your desktop called "styles."
  2. Using Firefox, go to http://www.inknoise.com/experimental/layoutomatic.php and select which type of "layout" you'd like: full page, two columns, or three columns (this tutorial uses the "Two Column (left sidebar)" layout).
  3. Select the View button, which will bring you to a page that has some gray lines and boxes. This is the skeleton of your page.
  4. Select View | Source (or Page Source). Copy the entire code.
  5. Open an HTML editor (HTML-kit on the PC, Taco on a Mac) , and start a new HTML document.
  6. Delete any code that shows up. Paste the code you just copied from step 3 into your new document. If your HTML editor has a Preview function, select it and you'll see the same gray boxes and lines the Layoutomatic created.
  7. Save your page to the desktop as: "test.html" -- or something like that.
  8. Open a new file and save that file in "styles" folder on the desktop as "stylesheet.css". Note: Do not save the file to the desktop; if you do the tutorial will not work.
  9. Go back to "test.html" and add lang="en" to the line that begins (2nd line of code) <html xmlns= so it begins like this instead: <html lang="en" xmlns=
  10. Still in "test.html", cut the following code:
    <style type="text/css">
    #container {
    width: 760px;
    \width: 780px;
    w\idth: 760px;
    border: 1px solid gray;
    margin: 10px;
    margin-left: auto;
    margin-right: auto;
    padding: 10px;
    }

    #banner {
    padding: 5px;
    margin-bottom: 5px;
    background-color: rgb(213, 219, 225);
    }

    #content {
    padding: 5px;
    margin-left: 215px;
    background-color: gray;
    }

    #sidebar-a {
    float: left;
    width: 200px;
    \width: 210px;
    w\idth: 200px;
    margin: 0;
    margin-right: 5px;
    padding: 5px;
    background-color: rgb(235, 235, 235);
    }

    #footer {
    clear: both;
    padding: 5px;
    margin-top: 5px;
    background-color: rgb(213, 219, 225);
    }
    </style>
    Press Save.
  11. Copy the following code and paste it in to "stylesheet.css" :
    #container {
    margin-left: auto;
    margin-right: auto;
    width: 760px;
    border: 1px solid gray;
    margin: 10px;
    padding: 10px;
    }

    * html div #container { /* This is the Tan hack */
    width: 782px;
    w\idth: 760px; }

    #banner {
    padding: 5px;
    margin-bottom: 5px;
    background-color: rgb(213, 219, 225);
    }

    #content {
    padding: 5px;
    margin-left: 215px;
    background-color: gray;
    }

    #sidebar-a {
    float: left;
    width: 200px;
    margin: 0;
    margin-right: 5px;
    padding: 5px;
    background-color: rgb(235, 235, 235);
    }

    * html div #sidebar-a { /* This is the Tan hack */
    width: 210px;
    w\idth: 200px; }

    #footer {
    clear: both;
    padding: 5px;
    margin-top: 5px;
    background-color: rgb(213, 219, 225);
    }
    These changes may not make sense now, but will be discussed on page 2 of the tutorial.
  12. Enter the following line just below the <head> tag:
    <link rel="stylesheet" href="styles/stylesheet.css" type="text/css" />
  13. Save the document. Open a Firefox, and then got to File | Open File, and open "test.html." From this point forward it is very important you preview the page in Firefox, and not in the HTML-kit preview window. Results will look different in the HTML-kit window -- especially when using advanced CSS.
  14. If you look back at "test.html" you will see code similar to this:
    <div id="container">
    <div id="banner"> </div>
    <div id="sidebar-a"> </div>
    <div id="content"> </div>
    <div id="footer"> </div>
    </div>
    The code corresponds to the gray lines and boxes in the following manner:
    layout with labels
  15. To help you remember what is what for now, please add text so your "test.html" page looks something like this: <div id="container">
    <div id="banner">This is my banner.</div>
    <div id="sidebar-a">This sidebar-a, where links can go </div>
    <div id="content">This is where my main content will go. </div>
    <div id="footer"> This is my footer.</div>
    </div>
    If you go back to the preview you will see something like the following:
    layout with text in their appropriate div
  16. Go to "stylesheet.css" and find the following bit of code: #content {
    padding: 5px;
    margin-left: 215px;
    background-color: gray;
    }
    This code controls the appears of the content section of your web page. Lets make some changes to the code, so it looks something like this: #content {
    padding: 0 5px;
    margin-left: 215px;
    background-color: white;
    border: 1px solid #333;
    }

    #content p {
    font-family: verdana, arial, sans-serif;
    color: #000;
    font-size: 12px;
    }
    Now go back to "test.html" and change <div id="content">This is where my main content will go. </div> so it looks like this: <div id="content"><p>This is where my main content will go.</p> </div> If you go back to the preview you will see something like the following:
    layout with stylized content area

Continue on page 2.

copyright 2003, 2004 by bill wolff . validates . css2 . xhtml . 508 . WAI 1,2,3