HTML & CSS Workshop Notes
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

HTML & CSS Workshop Notes

on

  • 25,811 views

Put on by USC's Upsilon Pi Epsilon as part of Wonderful World of Web2.0 Workshop Series.

Put on by USC's Upsilon Pi Epsilon as part of Wonderful World of Web2.0 Workshop Series.
http://pollux.usc.edu/~upe/

Statistics

Views

Total Views
25,811
Views on SlideShare
25,727
Embed Views
84

Actions

Likes
19
Downloads
660
Comments
0

6 Embeds 84

http://smashingweb.info 48
http://www.slideshare.net 10
http://ranjith.zfs.in 10
http://smashingweb.ge6.org 7
http://localhost 5
http://www.techiegyan.com 4

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

HTML & CSS Workshop Notes Presentation Transcript

  • 1. Sponsored by Upsilon Pi Epsilon The Computer Science Honors Society
  • 2. Upsilon Pi Epsilon
    • UPE is the Computer Science Honors Society.
    • It is a national honors society, with over 120 University Chapters around the country.
    • “New” to USC
  • 3.
    • Workshop series around web 2.0 technologies
    • This is the first of many
    • Future topics will include: Javascript, PHP, Ruby on Rails, and more.
    • Send us your ideas!
  • 4. What is Web 2.0?
  • 5.  
  • 6.
    • “Web 2.0, a phrase coined by O'Reilly Media in 2004, refers to a supposed second-generation of Internet-based services — such as social networking sites, wikis, communication tools, and folksonomies — that let people collaborate and share information online in previously unavailable ways.”
    • - Wikipedia (a Web 2.0 organization)
  • 7. Why should I care?
  • 8.  
  • 9. What We’ll Cover Today
    • HTML (Hypertext Markup Language)
    • DOM (Document Object Model - briefly)
    • CSS (Cascading Style Sheets)
  • 10. HTML
  • 11. History of HTML
    • Tim Berners-Lee created first HTML version in the late 1980s (as a subset of SGML)
      • Needed a simple way to share research among colleagues; piggy backed off newly evolving Internet (previously just text)
    • HTML spread as multiple proprietary versions; in 1993 the IETF published a working draft of the first “official” HTML
  • 12. History of HTML Part 2
    • Simplicity made things easy for people new to computers and publishing
    • Also left the “code” a mess, leaving every browser to handle different mistakes in its own way
    • Soon, the World Wide Web Consortium (W3C) was created to draft a set of standards for all web browsers to adhere to
  • 13. History of HTML Part 3
    • Features were added to HTML very quickly: tables, colors, backgrounds, fonts, etc.
    • Web sites started becoming very complex
    • It became impossible to manage all the HTML tags needed to style the content on multiple sites, code bases starting becoming huge, tables were being used to make better designs... things got ugly.
  • 14. History of HTML Part 4
    • We needed a solution to this problem, and that solution was CSS.
    • With the revolution of Cascading Style Sheets, HTML (and later XHTML) became about describing content, not presentation
    • The look of a web page (the presentation) was left entirely to style sheets, which could be common to entire sites
  • 15. Setting up a web “Presence”
    • No point to a website if no one else can see it...
    • USC lets every student create a web presence on the aludra.usc.edu server
    • If you don't have it setup yet:
      • telnet aludra.usc.edu
      • type requestwww
      • follow the instructions
  • 16. Setup Part 2
    • To see your web presence, point browser to http://www-scf.usc.edu/~username
    • To upload files to your web account, use an FTP client
    • You can download COREFTP(PC) or Fetch(Mac) from usc.edu/software or poke around your PC for an app with "FTP" in title
    • Login to aludra.usc.edu with usual USCWeb login
    • Upload files to public_html folder
  • 17. HTML: What is it?
    • HTML stands for Hyper Text Markup Language
    • An HTML file is a text file containing small markup tags
    • The markup tags tell the Web browser how to display the page
    • An HTML file can be created using a simple text editor or a WYSIWIG editor
  • 18. Hello World! <html> <head> <title>Hello World!</title> </head> <body> Hello World! </body> </html>
  • 19. HTML Basics: Tags/Attributes Tags/Attributes
    • HTML tags are used to mark-up HTML elements
    • Tags are surrounded by the two characters < and >, which are called angle brackets
    • Tags normally come in pairs like <b> and </b>. The text between the start and end tags is the element content
    • Tags are not case sensitive, <b> means the same as <B>, but use lowercase: you’ll find out its better
    • Tags often have attributes, which gives the browser additional information about displaying the element
    • Attributes come in name-value pairs, with the value in double or single quotes (e.g. <img width=”100px”>)
  • 20. HTML Basics: Formatting Tags Formatting Tags
    • In HTML, formatting is not based on whitespace! (example)
    • Use tags to format text:
    • <p></p> - paragraph tag, optional align attribute
    • <br> - line break tag
    • <b></b> or <strong></strong> - boldface tag, <strong> is more standards-compliant now
    • <i></i> or <em></em> - italics tag, <em> is more standards-compliant now
    • <ul><li>blabla 1</li> .. </ul> - unordered list tag, creates bulleted list, can be nested
    • <ol><li>blabla 1</li> .. </ol> - ordered list tag, creates numbered list, can be nested
  • 21. HTML Basics: Hyperlinks & Images Hyperlinks & Images
    • Anchor tag can be used to create hyperlink or define an anchor within a page
    • <a href=&quot; http://www.google.com &quot;>google</a> - creates hyperlink, optional target, title attributes, URL can be relative or absolute
    • <a name=&quot;section2&quot;></a> - creates anchor in page
    • <a href=&quot;index.html#section2&quot;>section2</a> - to link to in-page anchor
    • <img src=&quot;URL.gif&quot;> - creates image, optional width/height attributes, alt attribute to provide alternate text, align attribute to specify around-text wrapping, border attribute
    • Image tags can be nested in hyperlink tags to create hyperlinked images
  • 22. HTML Basics: Tables/Frames
    • Both of these are considered evil nowadays.
    • Before <DIVS> were introduced, people used tables to layout websites (e.g. multi-column website)
    • The HTML for tables is obtuse and prone to corruptibility (just try looking at the source of a fully tabled website)
    • But it exists...and could be occasionally useful
    • <table></table> - creates table, optional width/height/align/bgcolor attributes
    • <tr></tr> - creates table row with the same attribute options
    • <td></td> - creates table cell with the same attribute options
    • Frames: web-designers used to use frames to separate the navigation page from the site's content (e.g. all CS websites!)
    • Frames are generally a bad idea... http://www.karlcore.com/articles/article.php?id=2 So we won't tell you tags for them.
  • 23. HTML Basics: Forms
    • Very common on the web as they provide interactivity
    • <form></form> - defines form, optional method/name/action attributes to tell browser where to send results when submit pressed
    • <input></input> - generic input tag, used always with type attribute to specify type (checkbox, radio, text, submit), also optional name/value attributes
    • <textarea></textarea> - multi-line text area input, optional rows/cols attributes
    • <select> <option>op1</option> ... </select> - creates combo/dropdown box
  • 24. HTML Basics: Colors
    • HTML Basics: Color
    • Color is used extensively in HTML: text color, background color, border color, link color, hr color, etc
    • Only 16 color names are approved by W3C - aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow
    • All other colors should be referred to by Hexadecimal codes (#RRGGBB)
    • Always pick a pleasing color scheme for your site
    • Color references: http://w3schools.com/html/html_colors.asp http://www.degraeve.com/color-palette/ http://wellstyled.com/tools/colorscheme2/index-en.html http://wellstyled.com/tools/colorscheme2/index-en.html http://www.siteprocentral.com/cgi-bin/feed/feed.cgi
  • 25. HTML Basics: References
    • http://w3schools.com/html/default.asp
    • http://w3schools.com/html/html_quick.asp
    • http://webmonkey.com/webmonkey/reference/html_cheatsheet/
    • http://www.htmlcodetutorial.com /
    • http://validator.w3.org /
  • 26. Standards
    • Read the W3C Specs! Search them!
    • Use the W3C Validator!
    • Write valid XHTML Strict/Transitional (or HTML 4.1) whenever possible (always!)
    • Separate content and presentation: use style sheets to change the look of your site!
  • 27. Document Object Model
    • A graph representation of the structure of an HTML/XHTML document
    • An API for accessing and interacting with the graph and its elements
    • The key ingredient to DHTML, AJAX, and this whole Web 2.0 thing
    • Visualizer: http://www.aharef.info/static/htmlgraph/
  • 28. CSS
  • 29. Cascading Style Sheets
    • A standard method of applying style and appearance information to text and other elements of a web page
    • Cascading means that properties “cascade” down through all child elements of a given element
  • 30. Selectors
    • Style sheets are made up of individual style elements that define size, color, fonts, etc.
    • Each style has a unique name: a selector
    • Selectors refer to specific elements, or sets of elements, in your (X)HTML files
  • 31. Pseudo Selectors
    • pseudo selectors can select specific parts of an element, or elements with specific properties
    • allows us to create :hover effects
  • 32. Syntax
    • C style syntax
    • almost never need the @media type declaration, but it is very useful to know - can target different types of devices easily
    • adding a background color to the body:
    • body {
      • background: red;
    • }
  • 33. Style Sheets
    • To style a webpage, you need lots of individual selectors and styles
    • Create style sheets to contain all of these style definitions
    • add them to your page a number of ways:
    • <link rel=stylesheet href=&quot;whatever.css&quot; type=&quot;text/css&quot;>
    • <style type=”text/css”> @import: url(aStyle.css) </style>
    • or declare styles right in the style tag
  • 34. CSS Layout
    • There are two types of elements in the CSS world: box level elements, and inline elements
    • tags that would normally cause a newline in html are generally block level elements
    • <div> is the empty box element
    • text it usually inline content
    • <span> is the empty inline element
    • Any element can be told to be a box
  • 35. CSS Positioning
    • There are a few different ways to position box elements:
      • position
        • absolute
        • fixed
        • relative
      • float - most people are confused by this!
        • left
        • right
  • 36. Box Model
  • 37. CSS Properties http://www.ilovejackdaniels.com/css_cheat_sheet.pdf
  • 38. Demo
  • 39. Considerations
    • CSS does not behave as expected if your (X)HTML is not well formed: VALIDATE!
    • There are more tags that you will ever memorize, so look things up with google
    • CSS is complex - go home, read about it online, try things out. The best way to learn is probably to look at existing web pages CSS and see what does what
    • Oh, and its not exactly a standard...
  • 40. CSS Standards
    • CSS is a W3C standard
    • Unfortunately, Internet Explorer decided not to implement the standard the correct way
    • Generally, you will have to “hack” your CSS to get it to work the way you want in IE
    • Furthermore, there are multiple levels of support, and every browser varies on this
  • 41. CSS References
    • http://www.ilovejackdaniels.com/css_cheat_sheet.pdf
    • http://www.w3.org/Style/CSS/
    • http://www.w3schools.com/css/
    • http://www.csszengarden.com
    • http://meyerweb.com/eric/css/edge/
    • http://jigsaw.w3.org/css-validator/
  • 42. Questions?
  • 43. Contact
    • Pamela Fox: [email_address]
    • Ross Boucher: [email_address]
    • UPE: [email_address]
    • On the web: http://pollux.usc.edu/~upe/