Presentation is loading. Please wait.

Presentation is loading. Please wait.

INTERMEDIATE WEB DESIGN INTRODUCTORY CSS, JAVASCRIPT AND PHP.

Similar presentations


Presentation on theme: "INTERMEDIATE WEB DESIGN INTRODUCTORY CSS, JAVASCRIPT AND PHP."— Presentation transcript:

1 INTERMEDIATE WEB DESIGN INTRODUCTORY CSS, JAVASCRIPT AND PHP

2 HUH? Instructor: Miles, TA/GA in Instructional Technology Please ask questions. I will try my best to answer them. If I can’t, I will get back to you. Ask questions via chat, microphone, whatever you’re most comfortable. You can raise your hand to get my attention if I miss something. I hope to keep this under an hour, but this is the trial run, so I can’t promise anything. Everything done in this workshop was tested on the Idrive space available to all GSLIS students. Other web hosts may vary. Don’t get hung up on details. Look for connections and build on what you know.

3 CRASH COURSE See applications of common web technologies Get comfortable interacting with things you don’t necessarily know Learn basic structures, how to ask questions CSS PHP Javascript Keep it simple. We are not producing a beautiful, finished web site. That takes more than an hour.

4 DOWNLOAD THE FILES WE WILL USE TODAY I recommend following along with the slides, and then looking at the actual files later. Download link: http://courseweb.lis.illinois.edu/~mlincol2/workshop.zip You can upload these files to your Idrive to test them yourself, or look at the copy I have hosted at: http://courseweb.lis.illinois.edu/~mlincol2/workshop/http://courseweb.lis.illinois.edu/~mlincol2/workshop/ Software I use in the screenshots  Cyberduck (SFTP Client) (Windows alternative: WinSCP)  TextWrangler (Text Editor) (Windows alternative: Notepad++(?))  Firefox (Web Browser) with Firebug Extension (CSS Tool)

5 GETTING STARTED The files we will create today  index.php  style.css  menu.php

6 CSS Intended to simplify HTML Clean up messy code Unify style Designating individual style elements like font, size and color for every HTML element wastes time and is difficult to manage CSS simplifies this problem by letting you designate a style once, and link to that style multiple times Content 1 style Content 1 style Content 2 style Content 2 style Content 1 Content 2 style VS.

7 HTML This text is Arial, large. and red display This text is Arial, large. and red Con: Must be repeated for every element AKA in-line CSS OLD WAY

8 NEW WAY HTML Paragraph text will be gray and Helvetica. CSSp.newspaper { color: gray; font-family:”helvetica”; } display Paragraph text will be gray and Helvetica.

9 HOW IT’S ORGANIZED Html file includes reference to External stylesheet (CSS) in the tag Denotes a text file named style.css stored in the subdirectory “css” within the main directory Later, we will return to the tag to include Javascript. …

10 TABLE-LESS WEB DESIGN CSS is also used for layouts: this is a header … elements: Look at how much space is saved! General rule: don’t use a table unless you’re specifically displaying spreadsheet type info this is a header …

11 ORGANIZATION CONT. Side by side columns using the float property, rather than tables and columns menu content menu content

12 ORGANIZATION CONT. HTML: CSS: #div1 { Width:33%; Float:left; } #div1 { Width:33%; Float:left; } #div2 { Width:67%; Float:right; } #div2 { Width:67%; Float:right; } menu content

13 LINKING HTML AND CSS HTMLCSS.class1 { } #id2 { } Use “#” to style ID designators and “.” To style classes

14 WHY CSS? Can be applied to any HTML element Allows for flexible styling Edit once, change all Where you might see this: Modifying blog/CMS templates:  Wordpress, Tumblr, Drupal, etc.

15 BASIC HTML TEMPLATE Index.php css example page (this is where we will put our menubar with some links) (here is some text we will style using css.)

16 ADD TAGS Index.php css example page this is where we will put our menubar with some links here is some text we will style using css.

17 GIVE THE TAGS A CLASS Index.php … this is where we will put our menubar with some links here is some text we will style using css. …

18 PREPARE OUR CSS FILE Main.css.bodytext { }.menubar { }

19 ADD SOME STYLE Main.css.bodytext { color:blue; font-size:200%; }.menubar { font-family:arial; }

20 USEFUL TOOL: FIREBUG Firefox extension that tells you which stylesheet is determining an element’s style Useful for complicated setups with multiple stylesheets or when multiple styles are applied to the same element.

21 PHP Server-side scripting language  Installed on the server  Processes code embedded in your site PHP Includes: Similar to CSS, allows you to create something once, use it anywhere. Useful for areas that repeat on every page like headers, footers, menubars Adding a new link to the menubar is a one step process. CSS: centralizes style PHP Includes: centralize content

22 SERVER SIDE INCLUDES (SSI) HTML inserted into web page where you want the include to appear: Entire contents of an example include file: In-line PHP call: copyright 2012, your name copyright 2012, your name

23 CREATE OUR INCLUDE FILE Menu.php home link about link contact link

24 CALL THE INCLUDE FILE Index.php … here is some text we will style using css.

25 REPEAT The include file will appear on any page you call it. If you need to modify your menu, there is one central file to change (the include file), and the changes will appear in every HTML page where that include is called (version control)

26 JAVASCRIPT Writing your own code is hard Recycling someone else’s code is simple! We are using some Javascript from http://jscode.com/js_random_image.shtmlhttp://jscode.com/js_random_image.shtml Look for implementation examples, read code comments <<--… ## //

27 SCRIPT LIVES IN TWO PLACES (full script goes in the ) (call to script goes in the ) showImage(); includes full code includes call to the code

28 A LOOK AT THE CODE // Set up the image files to be used. var theImages = new Array() // do not change this // To add more image files, continue with the // pattern below, adding to the array. Remember // to increment the theImages[x] index! theImages[0] = '200.jpeg' theImages[1] = '300.jpeg’ // ====================================== // do not change anything below this line // ====================================== var j = 0 var p = theImages.length; var preBuffer = new Array() for (i = 0; i < p; i++){ preBuffer[i] = new Image() preBuffer[i].src = theImages[i] } var whichImage = Math.round(Math.random()*(p-1)); function showImage(){ document.write(' '); } 200.jpeg 300.jpeg Comments!

29 TW

30 A LOOK AT THE CODE showImage();

31 IN REVIEW We used CSS to style text on our website, and we can use it to change the look of a large amount of content easily. We used PHP Includes to control content on our website We used Javascript we found on the web to do a very simple task

32 BROWSER VIEW (FIREFOX)

33

34 WHAT IF I WANT TO LEARN SOMETHING ELSE? Google is your best friend Stack Overflow and w3schools, are great resources Codeyear and other guided lessons

35 QUESTIONS & COMMENTS & FEEDBACK help@support.lis.illinois.edu @gslis_help_desk


Download ppt "INTERMEDIATE WEB DESIGN INTRODUCTORY CSS, JAVASCRIPT AND PHP."

Similar presentations


Ads by Google