SlideShare a Scribd company logo
Sponsored by Upsilon Pi Epsilon The Computer Science Honors Society
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
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!
What is Web 2.0?
 
“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)
Why should I care?
 
What We’ll Cover Today HTML (Hypertext Markup Language) DOM (Document Object Model - briefly) CSS (Cascading Style Sheets)
HTML
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
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
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.
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
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
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
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
Hello World! <html> <head> <title>Hello World!</title> </head> <body> Hello World! </body> </html>
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”>)
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
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
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.
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
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
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 /
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!
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/
CSS
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
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
Pseudo Selectors pseudo selectors can select specific parts of an element, or elements with specific properties allows us to create :hover effects
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; }
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
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
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
Box Model
CSS Properties http://www.ilovejackdaniels.com/css_cheat_sheet.pdf
Demo
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...
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
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/
Questions?
Contact Pamela Fox:  [email_address] Ross Boucher:  [email_address] UPE:  [email_address] On the web:  http://pollux.usc.edu/~upe/

More Related Content

What's hot (20)

PPSX
computer language - Html frames
Dr. I. Uma Maheswari Maheswari
 
PPS
Web Development in Perl
Naveen Gupta
 
PDF
JavaFX fundamentals
Fulvio Corno
 
PPT
Asp.net.
Naveen Sihag
 
PPTX
Html coding
Briana VanBuskirk
 
PPTX
Bootstrap Framework
Yaowaluck Promdee
 
PDF
Javascript
Momentum Design Lab
 
PPT
Data Storage In Android
Aakash Ugale
 
PPT
Css
Manav Prasad
 
PPTX
Html Workshop
vardanyan99
 
PDF
Introduction to Bootstrap
Ron Reiter
 
PDF
Introduction to back-end
Mosaab Ehab
 
PPTX
ReactJS presentation.pptx
DivyanshGupta922023
 
PDF
WEB I - 01 - Introduction to Web Development
Randy Connolly
 
PDF
Introduction to HTML and CSS
Mario Hernandez
 
PPT
JQuery introduction
NexThoughts Technologies
 
PDF
Intro to HTML & CSS
Syed Sami
 
PPT
android layouts
Deepa Rani
 
PDF
Asp.net state management
priya Nithya
 
computer language - Html frames
Dr. I. Uma Maheswari Maheswari
 
Web Development in Perl
Naveen Gupta
 
JavaFX fundamentals
Fulvio Corno
 
Asp.net.
Naveen Sihag
 
Html coding
Briana VanBuskirk
 
Bootstrap Framework
Yaowaluck Promdee
 
Data Storage In Android
Aakash Ugale
 
Html Workshop
vardanyan99
 
Introduction to Bootstrap
Ron Reiter
 
Introduction to back-end
Mosaab Ehab
 
ReactJS presentation.pptx
DivyanshGupta922023
 
WEB I - 01 - Introduction to Web Development
Randy Connolly
 
Introduction to HTML and CSS
Mario Hernandez
 
JQuery introduction
NexThoughts Technologies
 
Intro to HTML & CSS
Syed Sami
 
android layouts
Deepa Rani
 
Asp.net state management
priya Nithya
 

Viewers also liked (20)

PPTX
Introduction to HTML and CSS
Ferdous Mahmud Shaon
 
PDF
Html / CSS Presentation
Shawn Calvert
 
PPT
Introduction to HTML
MayaLisa
 
PPT
Web Development using HTML & CSS
Shashank Skills Academy
 
PPT
CSS Basics
WordPress Memphis
 
PPT
cascading style sheet ppt
abhilashagupta
 
PDF
HTML CSS Basics
Mai Moustafa
 
PPT
Html Ppt
vijayanit
 
PDF
HTML + CSS
Pedro Gaspar
 
PDF
CSS Metaframeworks: King of all @media
Wynn Netherland
 
PDF
The importance of web design - Women Techmakers Galicia
Ana Cidre
 
PDF
Html css basic
健樺 古
 
PPTX
Instagram workshop
Bruno Bašić
 
PDF
Web Design Workshop
WebDesignWorkshop
 
PPTX
Instagram workshop for university post
Ida Blinkenberg Lidell
 
PDF
Website design and marketing workshop slides
Livia Oldland
 
PPTX
Facebook Workshop Powerpoint
skagitmarketing
 
PPTX
Facebook workshop
Deepan Chakravarthy
 
PDF
HTML&CSS 태그, 속성, 셀렉터
Booseol Shin
 
PPTX
3-2. selector api
JinKyoungHeo
 
Introduction to HTML and CSS
Ferdous Mahmud Shaon
 
Html / CSS Presentation
Shawn Calvert
 
Introduction to HTML
MayaLisa
 
Web Development using HTML & CSS
Shashank Skills Academy
 
CSS Basics
WordPress Memphis
 
cascading style sheet ppt
abhilashagupta
 
HTML CSS Basics
Mai Moustafa
 
Html Ppt
vijayanit
 
HTML + CSS
Pedro Gaspar
 
CSS Metaframeworks: King of all @media
Wynn Netherland
 
The importance of web design - Women Techmakers Galicia
Ana Cidre
 
Html css basic
健樺 古
 
Instagram workshop
Bruno Bašić
 
Web Design Workshop
WebDesignWorkshop
 
Instagram workshop for university post
Ida Blinkenberg Lidell
 
Website design and marketing workshop slides
Livia Oldland
 
Facebook Workshop Powerpoint
skagitmarketing
 
Facebook workshop
Deepan Chakravarthy
 
HTML&CSS 태그, 속성, 셀렉터
Booseol Shin
 
3-2. selector api
JinKyoungHeo
 
Ad

Similar to HTML & CSS Workshop Notes (20)

PPT
Download Workshop Lecture
webhostingguy
 
PPTX
Html starting
Rahul Dihora
 
PPT
Intro to html
anshuman rahi
 
PPT
Intro to html
anshuman rahi
 
PPT
introduction to web technology
vikram singh
 
ODP
Light introduction to HTML
abidibo Contini
 
PPT
Web Design-III IT.ppt
banu236831
 
PPT
WebDev Simplified Day 1 ppt.ppt
SarikaPurohit1
 
PDF
Intro to HTML 5 / CSS 3
Tadpole Collective
 
PPT
Lecture 4
uccwebcourses
 
PPTX
Markup Documents
Steven Cahill
 
PDF
1. HTML
Pavle Đorđević
 
PPT
Introduction to Web Technology and Web Page Development
BhargaviDalal4
 
PPT
Supplement web design
shelly3160
 
PPTX
Unit I- HTML, CSS, Bootstrap .pptx
dikshaahire256
 
PPT
xhtml_css.ppt
fakeaccount225095
 
PPTX
Episode 14 - Basics of HTML for Salesforce
Jitendra Zaa
 
PPT
XHTML and CSS
peak3
 
PDF
Sperimentazioni di Tecnologie e Comunicazioni Multimediali: Lezione 3
Salvatore Iaconesi
 
PPTX
An Overview of HTML, CSS & Java Script
Fahim Abdullah
 
Download Workshop Lecture
webhostingguy
 
Html starting
Rahul Dihora
 
Intro to html
anshuman rahi
 
Intro to html
anshuman rahi
 
introduction to web technology
vikram singh
 
Light introduction to HTML
abidibo Contini
 
Web Design-III IT.ppt
banu236831
 
WebDev Simplified Day 1 ppt.ppt
SarikaPurohit1
 
Intro to HTML 5 / CSS 3
Tadpole Collective
 
Lecture 4
uccwebcourses
 
Markup Documents
Steven Cahill
 
Introduction to Web Technology and Web Page Development
BhargaviDalal4
 
Supplement web design
shelly3160
 
Unit I- HTML, CSS, Bootstrap .pptx
dikshaahire256
 
xhtml_css.ppt
fakeaccount225095
 
Episode 14 - Basics of HTML for Salesforce
Jitendra Zaa
 
XHTML and CSS
peak3
 
Sperimentazioni di Tecnologie e Comunicazioni Multimediali: Lezione 3
Salvatore Iaconesi
 
An Overview of HTML, CSS & Java Script
Fahim Abdullah
 
Ad

More from Pamela Fox (20)

PDF
Teaching Programming Online
Pamela Fox
 
PDF
Engineering culture
Pamela Fox
 
KEY
Django Admin: Widgetry & Witchery
Pamela Fox
 
PDF
A Year of Hermit Hacking
Pamela Fox
 
PDF
The Developer Experience
Pamela Fox
 
PDF
Making JavaScript Libraries More Approachable
Pamela Fox
 
PPT
How I became a born again vegetable-tarian
Pamela Fox
 
KEY
The Developer Experience
Pamela Fox
 
PPT
No, Really, I'm Shy
Pamela Fox
 
PPT
Writing Apps the Google-y Way (Brisbane)
Pamela Fox
 
PPT
Writing Apps the Google-y Way
Pamela Fox
 
PPT
The Wonders of the "Onesie"
Pamela Fox
 
PPT
I’M A Barbie Girl In A CS World
Pamela Fox
 
PPT
Google Wave 20/20: Product, Protocol, Platform
Pamela Fox
 
PPT
Collaborative Mapping with Google Wave
Pamela Fox
 
PPT
Google Products: Deep Dive on Google Maps
Pamela Fox
 
PPT
Google Products & Google Maps
Pamela Fox
 
PPT
Mashups & APIs
Pamela Fox
 
PPT
A World of Words
Pamela Fox
 
PPT
Web APIs & Google APIs
Pamela Fox
 
Teaching Programming Online
Pamela Fox
 
Engineering culture
Pamela Fox
 
Django Admin: Widgetry & Witchery
Pamela Fox
 
A Year of Hermit Hacking
Pamela Fox
 
The Developer Experience
Pamela Fox
 
Making JavaScript Libraries More Approachable
Pamela Fox
 
How I became a born again vegetable-tarian
Pamela Fox
 
The Developer Experience
Pamela Fox
 
No, Really, I'm Shy
Pamela Fox
 
Writing Apps the Google-y Way (Brisbane)
Pamela Fox
 
Writing Apps the Google-y Way
Pamela Fox
 
The Wonders of the "Onesie"
Pamela Fox
 
I’M A Barbie Girl In A CS World
Pamela Fox
 
Google Wave 20/20: Product, Protocol, Platform
Pamela Fox
 
Collaborative Mapping with Google Wave
Pamela Fox
 
Google Products: Deep Dive on Google Maps
Pamela Fox
 
Google Products & Google Maps
Pamela Fox
 
Mashups & APIs
Pamela Fox
 
A World of Words
Pamela Fox
 
Web APIs & Google APIs
Pamela Fox
 

Recently uploaded (20)

PDF
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
PDF
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
PDF
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
PPTX
reInforce 2025 Lightning Talk - Scott Francis.pptx
ScottFrancis51
 
PDF
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
PDF
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
PDF
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
 
PPTX
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
PDF
UiPath Agentic AI ile Akıllı Otomasyonun Yeni Çağı
UiPathCommunity
 
PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
PDF
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
PPTX
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
PPTX
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
PDF
From Chatbot to Destroyer of Endpoints - Can ChatGPT Automate EDR Bypasses (1...
Priyanka Aash
 
PDF
Python Conference Singapore - 19 Jun 2025
ninefyi
 
PPTX
Simplifica la seguridad en la nube y la detección de amenazas con FortiCNAPP
Cristian Garcia G.
 
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
reInforce 2025 Lightning Talk - Scott Francis.pptx
ScottFrancis51
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
 
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
UiPath Agentic AI ile Akıllı Otomasyonun Yeni Çağı
UiPathCommunity
 
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
From Chatbot to Destroyer of Endpoints - Can ChatGPT Automate EDR Bypasses (1...
Priyanka Aash
 
Python Conference Singapore - 19 Jun 2025
ninefyi
 
Simplifica la seguridad en la nube y la detección de amenazas con FortiCNAPP
Cristian Garcia G.
 

HTML & CSS Workshop Notes

  • 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 &quot;FTP&quot; 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
  • 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/
  • 43. Contact Pamela Fox: [email_address] Ross Boucher: [email_address] UPE: [email_address] On the web: http://pollux.usc.edu/~upe/