Development Perspective: DIV and CSS HTML layout. Web Design. Lesson 2. Development Perspective: DIV/CSS



Similar documents
Web Design Basics. Cindy Royal, Ph.D. Associate Professor Texas State University

CST 150 Web Design I CSS Review - In-Class Lab

How To Create A Web Page On A Windows (For Free) With A Notepad) On A Macintosh (For A Freebie) Or Macintosh Web Browser (For Cheap) On Your Computer Or Macbook (

{color:blue; font-size: 12px;}

JJY s Joomla 1.5 Template Design Tutorial:

Essential HTML & CSS for WordPress. Mark Raymond Luminys, Inc mraymond@luminys.com

Chapter 7 Page Layout Basics Key Concepts. Copyright 2013 Terry Ann Morris, Ed.D

Web layout guidelines for daughter sites of Scotland s Environment

CSS for Page Layout. Key Concepts

Outline of CSS: Cascading Style Sheets

What is CSS? Official W3C standard for controlling presentation Style sheets rely on underlying markup structure

Web Design I. Spring 2009 Kevin Cole Gallaudet University

HTML and CSS. Elliot Davies. April 10th,

Using Style Sheets for Consistency

Web Design for Programmers. Brian Hogan NAPCS Slides and content 2008 Brian P. Hogan Do not reproduce in any form without permission

Web Authoring CSS. Module Descriptor

Contents. Downloading the Data Files Centering Page Elements... 6

CSS. CSS - cascading style sheets CSS - permite separar num documento HTML o conteúdo do estilo. ADI css 1/28

How to Properly Compose HTML Code : 1

HTML CSS Basic Structure. HTML Structure [Source Code] CSS Structure [Cascading Styles] DIV or ID Tags and Classes. The BOX MODEL

Coding Standards for Web Development

Dreamweaver CS4 Day 2 Creating a Website using Div Tags, CSS, and Templates

Kentico CMS, 2011 Kentico Software. Contents. Mobile Development using Kentico CMS 6 2 Exploring the Mobile Environment 1

Web Design and Databases WD: Class 7: HTML and CSS Part 3

CSS 101. CSS CODE The code in a style sheet is made up of rules of the following types

CSS - Cascading Style Sheets

Web Design with CSS and CSS3. Dr. Jan Stelovsky

ICE: HTML, CSS, and Validation

The Essential Guide to HTML Design

CREATING HORIZONTAL NAVIGATION BAR USING ADOBE DREAMWEAVER CS5

Last week we talked about creating your own tags: div tags and span tags. A div tag goes around other tags, e.g.,:

CREATING A NEWSLETTER IN ADOBE DREAMWEAVER CS5 (step-by-step directions)

CIS 467/602-01: Data Visualization

GUIDE TO CODE KILLER RESPONSIVE S

Responsive Web Design for Teachers. Exercise: Building a Responsive Page with the Fluid Grid Layout Feature

Introduction to Web Design Curriculum Sample

MCH Strategic Data Best Practices Review

Further web design: Cascading Style Sheets Practical workbook

Introduction to Adobe Dreamweaver CC

Intro to Web Design. ACM UIUC

Web Building Blocks. Joseph Gilbert User Experience Web Developer University of Virginia Library

Style & Layout in the web: CSS and Bootstrap

Garfield Public Schools Fine & Practical Arts Curriculum Web Design

Web Design and Development ACS Chapter 9. Page Structure

Designing HTML s for Use in the Advanced Editor

Mobile Web Site Style Guide

HTML TIPS FOR DESIGNING

Base template development guide

Basics of HTML (some repetition) Cascading Style Sheets (some repetition) Web Design

Create Your own Company s Design Theme

Basic tutorial for Dreamweaver CS5

Microsoft Expression Web Quickstart Guide

Simply download Beepip from and run the file when it arrives at your computer.

Selectors in Action LESSON 3

Web Development I & II*

Advanced Editor User s Guide

Dreamweaver CS5. Module 1: Website Development

ITNP43: HTML Lecture 4

CHAPTER 10. When you complete this chapter, you will be able to:

How To Customize A Forum On Vanilla Forum On A Pcode (Forum) On A Windows (For Forum) On An Html5 (Forums) On Pcode Or Windows 7 (Forforums) On Your Pc

Appendix H: Cascading Style Sheets (CSS)

Advanced Web Design. Zac Van Note.

Creating a Resume Webpage with

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence

Campaign Guidelines and Best Practices

User Guide for Smart Former Gold (v. 1.0) by IToris Inc. team

We automatically generate the HTML for this as seen below. Provide the above components for the teaser.txt file.

Dreamweaver and Fireworks MX Integration Brian Hogan

How To Design A Website For The Decs

Chapter 1. Introduction to web development

Blueball Design Dynamic Content 2 Stack Readme Manual v1.0

Cascading Style Sheet (CSS) Tutorial Using Notepad. Step by step instructions with full color screen shots

Web Design Revision. AQA AS-Level Computing COMP2. 39 minutes. 39 marks. Page 1 of 17

HOW Interactive Design Conference 2013

Interactive Data Visualization for the Web Scott Murray

Create Webpages using HTML and CSS

8 STEPS TO CODE KILLER RESPONSIVE S

Learning Web Design. Third Edition. A Beginner's Guide to (X)HTML, Style Sheets, and Web Graphics. Jennifer Niederst Robbins

Creator Coding Guidelines Toolbox

Using an external style sheet with Dreamweaver (CS6)

ITP 101 Project 3 - Dreamweaver

Adobe Illustrator CS6. Illustrating Innovative Web Design

Creating Web Pages with Dreamweaver CS 6 and CSS

Style Guide Provided courtesy of Innovative Emergency Management Inc.

01/42. Lecture notes. html and css

Web Developer Jr - Newbie Course

Table of Contents THE DESIGNER S GUIDE TO CREATING NEWZAPP DRAG AND DROP TEMPLATES... 6 THE NEWZAPP SYSTEM... 7

Contents. Introduction Downloading the Data Files... 2

CS134 Web Site Design & Development. Quiz1

Web publishing: An introduction to CSS

Coding HTML Tips, Tricks and Best Practices

Dashboard Skin Tutorial. For ETS2 HTML5 Mobile Dashboard v3.0.2

Cascading Style Sheets (CSS)

Transcription:

Web Design Lesson 2 Development Perspective: DIV/CSS

Why tables have been tabled Tables are a cell based layout tool used in HTML development. Traditionally they have been the primary tool used by web developers to control the position of images, navigation and general web content. While they can be useful, their rigid structure and bloated mark up can make development a tedious and confusing task. As well as leading to a larger page size their nested code structure can be dizzying, making updating very difficult. Furthermore, controlling structure between separate HTML pages is not controlled globally requiring the same HTML code to be used is multiple instances, making consistency very difficult. Keeping to the underlying goal of creating simple, seamless and light code structures, developers sought a new way of controlling layout. The answer; split up structure and style by coding HTML pages with DIV tags rather then tables and controlling their display using a Cascading Style Sheets (CSS). DIV Tags <div> The <div> tag defines logical divisions within the content of a page. When used properly they can create a simple definition for a page s content layout. Structurally, a <div> tag is only useful when given an class name from a CSS file. <div class= header > What does it look like? Visually a <div> tag is a box that can be proportioned any way you choose. When you start a DIV tag using <div> you are creating the opening top-left corner of the box. The box is not complete (or programmatically created) until you close it using the tag which closes off the bottom-right corner. You can place <div> tags in inside of one another to create boxes inside of boxes until you reach your desired structure. Nearly any HTML tag or content can be placed inside of <div> tags. <div class= content > <div class= header > My Site is Smart.

Controlling style The <div> tag has a tremendous amount of controllable characteristics. Unlike its <table> counterpart, using nested <div> tags allows a developer quick and decisive control of layout while adjusting for margin, border, padding, typography and much more under a uniform set of rules defined in a CSS file. The CSS file (Cascading Style Sheet) is a separate document that simply contains the styles for your HTML document. On its own it is useless and does not get rendered by a browser until it is linked within the <head> tag of an HTML page. HTML page (index.html) <head> <link rel= stylesheet href= screen.css type= text/css /> </head> Styles that are used in the HTML page are created within the CSS file itself. These styles can overwrite the default settings of any HTML tag (<p>, <body>, <h1> etc.) or define style rules for any class name (class= my_class_name ) or id (id= my_ id_name ) you wish. When defining styles it is important to note that you create the name of the style and can name it whatever you wish. Take careful note that your CSS rule is named exactly as it is referenced in the HTML. HTML file (index.html) <div class= my_class_name > CSS file (screen.css).my_class_name {

Special care must be taken when defining rules in a CSS file. A rule is simply the definition of a style structure for a given HTML element. A rule can be applied to native HTML tags, classes or IDs. The discretion as to which entity the rule will be applied too is called the selector and is defined at the time the rule is created in the CSS file. Defining a tag An HTML tag definition <body> A class definition <div class= my_class_name > An id definition <div id= my_id_name > selector { declaration; HTML tag selectors are defined by the tag name. body { Class selectors are defined by the class name with a leading period (.).my_class_name { ID selectors are defined by an ID name with a leading number symbol (#) #my_id_name {. Declarations Inside each selector rule is the declaration of what your style does. This is articulated by a series of property definitions. Each property you wish to control must be declared to the left of the desired value, separated by a colon (:) and ending with a semi-colon (;). Declaration syntax body { property: value; Example body { font-family: Arial ; font-size: 12px;

Using Classes and IDs A class is a global element that is used more then once during the display of an HTML page. An ID is an element that is used only once. Class usage When defining the layout of a page you may use a class to dictate a general style of system text. CSS (screen.css).big_font { font-size: 2em; HTML (index.html) <div class= big_font > This a is a heading <p>this text gets <span class= big_font >REALLY BIG</span></p> ID usage An ID on the other hand would be used for an element that appears once, such as a navigation block. CSS (screen.css) #my_navigation { padding-top: 10px; HTML (index.html) <div id= my_navigation >

Preparation is vital 1. Setup Design Correctly 2. Explore structure early Possible <div> class setup Before moving into the development of a page the appropriate forethought must be considered. A good game plan will aid in creating the right code for you web site. Take the time to perform the following tasks before moving into code. Ensure design items line up in your original document. Using guides and rulers will help you understand the spacing and placement of your DIV structure. Analyze your design to ensure you understand how the layout can be reflected by a <div> structure. If necessary, print out your design and draw boxes around all content items. A simple rule; if two or more elements sit side-by-side horizontally, contain those elements in a <div> block. frame header logo navigation container sidebar content footer 3. Create template files Once you have determined the underlying structure, create template files that will contain the common layouts of your site. At a minimum this would mean creating a template HTML file and your global CSS file. When your templates are complete they can be used as production files for your site. Example folder structure > Sites > MyWebsite - index.html > styles - screen.css

Tying it all together With solid preparation you can now begin development. To begin, open your template HTML file and write a <div> tag structure based on your layout analysis. In our example it might look like this. index.html code <html> <head> <title>acad Website</title> <link rel= stylesheet href= styles/screen.css media= screen type= text/ css /> </head> <body> <div class= frame > <div class= header > <div class= logo > <img src= images/logo.gif width= 154 height= 17 > <div class= navigation > <div class= nav ><a href= index.html >Home</a> <div class= nav ><a href= work.html >Work</a> <div class= nav ><a href= about.html >About</a> <div class= nav ><a href= location.html >Location</a> <div class= container > <div class= sidebar > <img src= images/callout.gif width= 206 height= 105 > <br/> <img src= images/callout.gif width= 206 height= 105 > <div class= content > <h1>my Website</h1> <p>my website is great!</p> <div class= footer > Copyright Paul Bazay </body> </html>

Style using CSS Previewing this HTML file in the browser will initially show unexpected results. The content is not anywhere near what you are after. This is because the structure is in place but the styles for each element have not been delivered to the page. In order to control the proportions, positions, margin, padding, typography and colors of your elements you must create them in your CSS file. Our sample CSS file might look like this. styles/screen.css code body{ h1 { p { background-color: #FFFFFF ; margin-top: 100px; margin-left: 46px; font-size:18px; font-family: Arial; font-weight:bold; font-size:12px; font-family: Arial; line-height: 18px;.navigation a:hover { color: #FF0000;.navigation a:active { color: #333333;.navigation a:visited { color: #666666;.nav { margin-right:25px;.container { width:950px;.header { width: 860px; height: 100px;.logo { width: 206px;.navigation { width:591px; float: right; font-size:12px; font-family: Arial; font-weight: bold; line-height: 18px;.navigation a { text-decoration: none; color: #000000;.content { width:860;.sidebar { width: 206px;.main_content { width:591px; margin-top:-14px; float: right;.footer { margin-top: 52px; padding-top: 16px; border-top: 1px solid #3a94ae; font-size:10px; width:860px; font-family: Arial;

Visual Communications Department VSCM 225 Design Technologies Instructors: Mike Giroux, Guy Parsons, Neil Petrunia Development Office 573A E-mail: Perspective: neilpet@shaw.ca DIV and CSS Phone HTML 263-7025 layout Office Hours: Noon - 2 pm by appointment Project 2 Sketchsite Discussion DIV/CSS HTML development Objective Using the coding principles you have learned you must create a functioning website to house web-content that you will create in future assignments throughout this class. Project Using HTML text editor only Similar to a traditional shetchbook, your sketchsite will function as a place for you to explore new concepts and techniques as learned. Although the pages of your sketchsite will initially be blank (with the exception of interface design) you will need to consider the following items: How will your visitors know it is your sketchsite? How will your visitors successfully navigate the pages of your sketchsite? How will you manage your sketchsite as it grows? Information Architecture Navigation Interface Applications Online Examples Your sketchsite must contain 5 pages (min) properly coded using a DIV structure with styles controlled via a CSS file. The pages of your sketchsite must be able to access all pages from any page. Design. Your sketchsite must clearly communicate who owns the site and be reflective of the website goal. Coda, TextEdit, TextMate (Mac), Komodo Edit, Notepad (PC) Photoshop, Illustrator http://ffffound.com http://www.destroyrockcity.com http://www.presstube.com Due date Monday September 29th, 2008