Creating Web Documents

Slides:



Advertisements
Similar presentations
Cascading Style Sheets
Advertisements

CSS-Formatting Review Cascading Style Sheets addstyle to your HTML web pages.
Layout using CSS. Using multiple classes In the head:.important{font-style:italic;}.title{color:red;} In the body: Here's a type of paragraph that is.
Introduction to CSS.
Very quick intro HTML and CSS. Sample html A Web Title.
Part 5 Introduction to CSS. CSS Display - Block and Inline Elements A block element is an element that takes up the full width available, and has a line.
Cascading Style Sheets. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. CSS is a.
Cascading Style Sheets By: Valerie Kuna. What are Cascading Style Sheets? Cascading Style Sheets (CSS) are a standard for specifying the presentation.
Building a Website: Cascading Style Sheets (CSS) Fall 2013.
กระบวนวิชา CSS. What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to.
Unit 20 - Client Side Customisation of Web Pages
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
4.01 Cascading Style Sheets
ULI101: XHTML Basics (Part III) Introduction to XHTML / Continued … Block-Level vs. Inline Elements (tags) Manipulating Text,  , Text Characteristics,,,,,,,,,,,,,,,
Creating Web Documents: JavaScript, continued Tool reports Creating new windows Form input verification Homework: read about JavaScript, start planning.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
CSS Introductions. Objectives To take control of the appearance of a Web site by creating style sheets. To use a style sheet to give all the pages of.
Creating Web Documents CSS examples (do more later) Lab/Homework: Read chapters 15 & 16. Work on Project 3, do postings.
WebD Introduction to CSS By Manik Rastogi.
CSS.
Cascading Style Sheets
Cascading Style Sheets (CSS) Internal Style Sheets Classes
CSS Cascading Style Sheets
Internal Style Sheets External Style Sheets
CS3220 Web and Internet Programming CSS Basics
4.01 Cascading Style Sheets
Webpage layout using CSS
Concepts for fluid layout
Cao Yuewen SEEM4570 Tutorial 03: CSS Cao Yuewen
Madam Hazwani binti Rahmat
Floating & Positioning
Cascading Style Sheet (CSS)
Cascading Style Sheets
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Introduction to CSS.
Introduction to Web programming
CS 174: Server-Side Web Programming February 7 Class Meeting
Styles and the Box Model
The Internet 10/13/11 The Box Model
Cascading Style Sheets
DynamicHTML Cascading Style Sheet Internet Technology.
5.2.3 Be able to use HTML and CSS to construct web pages
Cascade Style Sheet Demo W3Schools. com: w3schools
CMPE 280 Web UI Design and Development September 4 Class Meeting
Stylin’ with CSS.
Web Programming– UFCFB Lecture 11
What are Cascading Stylesheets (CSS)?
Cascading Style Sheets™ (CSS)
DynamicHTML Cascading Style Sheet Internet Technology.
HTML and CSS MIS 2402 Jeremy Shafer Department of MIS
Floating and Positioning
CS3220 Web and Internet Programming CSS Basics
Part 1: Cascading Style Sheets
CMPE 280 Web UI Design and Development February 7 Class Meeting
Introduction to DHTML, the DOM, JS review
CS3220 Web and Internet Programming CSS Basics
Programming games Share your plans for your virtual something.
Session 3: Basic CSS Spring 2009
Johan Ng and Muhammad Hazzry
The Internet 10/20/11 CSS Layout
Stylin’ with CSS.
Concepts for fluid layout
4.01 Cascading Style Sheets
Stylin’ with CSS.
Session IV Chapter 15 - How Work with Fonts and Printing
Cascading Style Sheets
Cascade Style Sheet Demo W3Schools. com: w3schools
CMPE 280 Web UI Design and Development September 5 Class Meeting
Internal Style Sheets External Style Sheets
Presentation transcript:

Creating Web Documents Cascading Style sheets layout Preview: dynamic HTML Homework: Project 3, best/worst posting

Styles can Specify formatting for all examples of existing tags, H2 {text-align: center} <h1>….</h1> p {font: normal 14pt "Arial"} <p>…. </p> some subset of existing tags p.intro {text-indent: 10pt; font: italic} <p class="intro">….</p> a new type of tags DIV.inserts {color: red; background: white; text-align:left} <div class=inserts>….</div>

Styles can be for... an individual instance of a standard tag p#first {text-align:left; color: blue} <p id="first">…</p> an individual instance of a new tag div#special {color:cyan; font-family: Verdana} <div id="special">….</div> a class of a new tag div.side { } <div class="side"> </div>

Styles for layout Can specify position and wrapping (float) Position absolute means in terms of parent. This could be the body tag, in which case it is the window relative means in terms of where it would go otherwise Positioning can cause overlap. The z-index can specify what goes on top.

Example of flying bird Uses style div tag Uses JavaScript newmedia.purchase.edu/~Jeanine/movetest.html Uses style div tag Uses JavaScript functions setInterval (timed event) testing for different environments Example of Dynamic HTML Preview of Creating Dynamic Web Documents (Spring course)

One style in head section <style type="text/css"> #bird {position: absolute; top: 400px; left: 400px; } </style>

Instance of 'div' in body <body> <div id="bird"> <img src="bird.gif" width=100 height=100> </div> Need to make it a 'div' in order to refer to its style attributes

In script section, in head Global variables var swidth = screen.width; var sheight = screen.height; var iwidth = 100; var iheight = 100 var currentx = 400; var currenty = 400; var tid; var xv = 5 ; var yv = -10; functions getObj(name) --more general than needs to be move(deltax, deltay) startflying() stopflying() setspeeds(f) fly() All use global data

Calling 6 different links call the move function 6 different ways corresponding to up, down, left, right, up & left, down & right 1 link calls the startflying function startflying: tid = setInterval("fly()", 250); fly function calls move(xv, yv); 1 link calls stopflying function stopflying: clearInterval(tid);

Code to 'get' the object function getObj(name) { if (document.getElementById) {this.obj = document.getElementById(name); this.style = document.getElementById(name).style; } else if (document.all) { this.obj = document.all[name]; this.style = document.all[name].style; } else if (document.layers) { this.obj = document.layers[name]; this.style = document.layers[name]; } } Uses the trick of checking if a method exists, if it does, use it! This is better than checking for IE vs Netscape4 vs Netscape 6 but is equivalent.

function move(deltax, deltay) { var x = new getObj("bird"); currentx += deltax; currenty += deltay; x.style.top = currenty; x.style.left = currentx; // Check for going off screen // position may change for next move if (currentx>swidth) { currentx = 0; } if (currenty>sheight) { currenty = 0;} if ((currentx + iwidth)<0) { currentx = swidth; } if ((currenty+iheight)<0) { currenty = sheight;} }

function startflying() { tid = setInterval("fly();",250); } function stopflying () { clearInterval(tid);

Fly function (which calls move) function fly(){ move(xv,yv); }

setspeeds, which picks up values from form f function setspeeds(f) { xv = 1*f.hspeed.value; yv = 1*f.vspeed.value; return false; } Multiply to turn text into a number!!!

<div id="bird"> <img src="bird.gif" width=100 height=100> </div> <a href="javascript:move(0,50);">Move down </a> <br> <a href="javascript:move(0,-50);">Move up </a> <br> <a href="javascript:move(50,0);">Move right </a> <br> <a href="javascript:move(-50,0);">Move left </a><br> <a href="javascript:move(50,50);">Move down and right </a> <br> <a href="javascript:move(-50,-50);">Move up and left </a> <br> <a href="javascript:startflying();">Start flying </a> <br> <a href="javascript:stopflying();">Stop flying </a> <br> <form name="fx" onsubmit= "return setspeeds(this);" > Horizontal Speed Factor<input type="text" name="hspeed" > Vertical Speed Factor <input type="text" name="vspeed" ><br> <input type="submit" value="Set speeds"> </form>

Check on-line rachel.ns.purchase.edu/~Jeanine/jsexamples.html move test rachel.ns.purchase.edu/~Jeanine/movetest.html Expanded 'dog' (dog dies if it gets too thin or too fat) rachel.ns.purchase.edu/~Jeanine/pet3.html

Best practices Your opinion may differ, but read for ideas. Jakob Nielsen, http://www.useit.com/ http://www.iarchitect.com/index.htm Review Web Style Guide other Try to find other sources on best practices. Consider what they say: use it to help you articulate your own ideas.

Homework Do as posting: find a good and bad web site (in terms of design and execution). Say why! Use what you have learned. Have your views changed? Be articulate. Project 3 due on May 6 to show in class (get feedback and help). You must ftp to the rachel site OR another site & send the TA a note by May 8. This gives Kate and Melissa a chance to update the class page (earlier would be nice and give you time to check the link). Practice quiz will be posted. Final/quiz May 13 (need to find a room. Don’t change your mind based on any of the readings.