SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Downloaden Sie, um offline zu lesen
A Rails Girls Introduction
to
HTML & CSS
Rails Girls Helsinki, Finland, Spring 2015
Timo Herttua & Vesa Vänskä
Agenda
1. Why HTML & CSS are crucial in life?
2. Why HTML & CSS are crucial in RG?
3. Bonus: Why to learn them already today and not
tomorrow
4. Division of Labor on the Internet
5. The Front-end Bentobox
6. Live demo: Codeacademy
7. Extra credit exercise
8. Appendix: instructions, HTML primer, Frontend
Bentobox
Why HTML & CSS
● Perhaps the single most important, and easiest to grasp entry point to
the world of web tech
○ WYSIVCTWYG or “What you see is very close to what you get”
● Many of today’s professional developers started with making websites
● The other entry point you typically hear is computer graphics (CG) and/or
games (i.e. the Finnish Demoscene*) – which are much more difficult to
make than websites
● The third, and perhaps hardest entry point, is tinkering with hardware (e.g.
Commodore, Amiga, Arduino, Raspberry Pi, drones, robots, etc.), because
of so many moving parts and “low level” programming languages
involved
*Wikipedia article about the Demoscene: http://en.wikipedia.org/wiki/Demoscene; A Finnish TV series about the Demoscene: http://areena.yle.
fi/tv/demoscene; Grand Cru’s account of the Demoscene: http://grandcrugames.com/2013/03/what-the-hll-is-in-the-water-of-finland/
HTML & CSS in the Internet
● Close to everything you see on the internet is a
combination of HTML, CSS & JavaScript
● Even some apps on iOS & Andoid are made with them
(e.g. Facebook’s first gen mobile)
● Web browser is the universal app that everyone has
● HTML, CSS & JS are the language of the web, and the
web browsers
● HTML, CSS & JS are open source standards, meaning
that no plugins are required to run them
Role of HTML & CSS in Rails Girls
● Rails Girls is an introduction to (web application)
technology
● Rails in Rails Girls refers to “Ruby on Rails”, a popular
web application programming framework (Rails) built
with the Ruby programming language
● Web applications are pieces of software that
dynamically generate HTML pages that make further
use of CSS and JavaScript to make them more visually
pleasing and interactive
Today: HTML; tomorrow: (among other
things) dynamic generation of HTML
● Web applications are used to transmit and transform
information by dynamically generating HTML based
on user inputs (e.g. Facebook’s chat)
● In order to understand web applications, you need to
understand HTML
● In order to make web applications pretty, you need
CSS
● In order to make web applications more interactive /
responsive, you need JavaScript
A bonus “why”
● By engaging with HTML & CSS today, you’ll
increase your chances of getting access to
a personal coach for a 3-6 month period to
help you enter the world of web tech in great
company!
● Details on how exactly, stay tuned for more
info later in the presentation
What is a website made of?
● An HTML page is
○ a structured text file with hyperlinks
■ to other HTML pages
■ to assets, such as
● embedded files, that the browser can display, such as
○ images
○ videos
○ audio
● CSS stylesheets
● script files (JavaScript)
● downloadable files such as PDF’s,
A website, “visually”
<html>
<head>
<title>Google</title>
<link rel="stylesheet" type="text/css" href="
/style/style.css">
</head>
<body>
<div id="logo" style="/images/logo.png"></div>
<input id="keywords">
<button id="search">Google Search</button>
<button id="lucky">I'm Feeling Lucky</button>
</body>
</html>
HTML: http://www.google.com/index.html
or just http://google.com
body {
background-color: white;
}
button {
background-color: light grey;
}
Stylesheet: style.css
Google logo: logo.png
Connected devices such as
smart TV’s
Clients and servers
Server (a.k.a backend a.k.a. the cloud)
Desktop web browser
Mobile device web browser &
embedded browsers in
“hybrid apps”
Client (a.k.a frontend) examples:
The cloud (=many
servers someone else
like Amazon or Google
owns, priced per usage
per month, not per
physical server)
Structured data
(HTML, JSON, XML, …)
HTTP request - response cycle
Browser Server
1. Request to http://google.com
2. Server decides what it
wants to respond
Web
page
3. The response tells the
browser what to show in the
browser
4. The browser renders the
page
Division of labor on the Internet
For browsers:
HTML
<h1>This is a heading</h1>
<p>This is a paragraph</p>
<img src=”cat_picture.gif” />
<video><source src=" cat_video.mp4"
type="video/mp4"></video>
For JS / servers:
JSON / XML
{“presenters”: [{“id”:
1, “name”: “Vesa”},
{“id”: 2, “name”:
“Timo”}]}
Structured content
CSS
body {
background-color: red;
};
JavaScript
confirm(“Are you ready
for some cat vids?”);
// OK or Cancel
Adobe
Flash
Microsoft
Silverlight
...
The Browser (=frontend)
(e.g. Chrome, Firefox, Safari, ..)
Style & behavior
Rails, CakePHP, Django, Spring
Ruby, PHP, Python, Java
Frameworks
(=productivity tools by programmers for
programmers)
Languages
(=ways to instruct machines)
The Server
(=backend)
(proprietary)
Browser plugins
What was all that Confucianism?
The Rails Girls workshop
uses the Bentobox model
to make the world of tech
more approachable by
helping you attach
meaning to the many
acronyms of tech (HTML,
JS, CSS, etc.)
Read more:
http://blog.railsgirls.com/post/20405930015/bentobox-learn-the-language-of-technology
Using the Bentobox today
Frontend Bentobox
Backend
(tomorrow’s subject)
Frontend Bentobox
The Browser (=frontend)
The Frontend Bentobox
The Server (=backend)
(i.e. “not frontend” stuff)
Behavior
Style
Content for browsers Content for servers / backend
Frontend Bentobox
The Browser (=frontend)
The Frontend Bentobox: acronyms
The Server (=backend)
(i.e. “not frontend” stuff)
Behavior
Style
Content for browsers Content for servers / backend
HTML
<h1>This is a heading</h1>
<p>This is a paragraph</p>
<img src=”cat_picture.gif” />
<video><source src=" cat_video.mp4"
type="video/mp4"></video>
CSS
body {
background-color: red;
};
JavaScript
confirm(“Are you ready
for some cat vids?”);
// OK or Cancel
JSON / XML
{“presenters”: [{“id”:
1, “name”: “Vesa”},
{“id”: 2, “name”:
“Timo”}]}
Ruby
Rails
MongoDB Hadoop
Backbone Bacon.js
Frontend Bentobox
The Browser (=frontend)
The Frontend Bentobox: tasks
The Server (=backend)
(i.e. “not frontend” stuff)
Behavior
Style
Content for browsers Content for servers / backend
Display a picture of a kitteh
Make the background red
Confirm that the
user actually
wants to delete a
file
Transfer World Bank
statistics needed to
determine relationship
of GDP and birth rate
Perform serious data crunching on which
kitteh should be shown to which user
Frontend Bentobox Exercise:
acronyms & tasks
Rules: Figure out the term and place it on the
bentobox in the right place. There might be
false friends and doubles. Googling allowed!
● HTML
● JavaScript
● PHP
● EcmaScript
● CSS
● Java
● jQuery
● Angular
● JSON
● Ember
● XML
● Rails
● Make the font size bigger
● Have a chat app show new
messages without having to refresh
the page
● Show an ordered list of items
(e.g. todo list)
Acronyms Tasks
Live demo:
HTML & CSS on Codecademy.com
Let’s look at the first exercise, “HTML Basics”:
http://www.codecademy.com/en/tracks/web
Extra credit exercise: earn a badge!
● Option 1: CodeSchool.com video course https://www.
codeschool.com/courses/front-end-foundations
(requires a free signup, the part about HTML is free)
● Option 2: Codecademy.com text-based course http:
//www.codecademy.com/en/tracks/web
(requires a free signup, the whole course is free)
● For extra credit:
○ Post a link to your badge(s) here (see appendix for instructions):
https://docs.google.com/a/efekta.fi/forms/d/1DlXmnyicUvmvprjipXTyBdALoymksF1b9irtv5TDLPc/viewform
Appendix
Extra Credit Instructions: How to find the
URLs to badges
http://www.codecademy.com/users/username/achievements
CodeCademy.comCodeSchool.com
https://www.codeschool.com/users/12345
HTML primer: principles
● HTML documents are a set of nested “tags” which
declare the structure of a document
○ e.g. <p>This is a paragraph of text</p>
● Most tags have a starting tag (<[tag]>) and an
ending tag (</[tag]>)
● Tags can be nested inside each other, e.g.
HTML “hello world”, or a very simple
example – open up a text editor*, save to
index.html and open with a web browser
<body>
<h1>Hello Rails Girls!</h1>
<h2>Menu</h2>
<ul>
<li><a href=”about.html”>About</a></li>
</ul>
<p>If you paste this into a text file and save it as index.
html, it should work if you open it in your browser.</p>
</body>
* text editor is a (desktop) application that edits plain text files, for example HTML, CSS, JavaScript
and Ruby. Examples of free text editors are: https://atom.io/ http://www.sublimetext.com/ or http:
//brackets.io/
HTML primer: basic tags
<html> </html> HTML tags declare the file is an HTML document. Everything else is nested inside
these tags.
<h1> </h1>
<h2> </h2>
Heading tags (H1, H2, H3, H4, ..) are meant for declaring different levels (H1 is more
important than H2) of headings
<ul> <li></li> </ul>
<ol> <li></li> </ol>
UL (unordered list) and OL (ordered list) declare lists of list items, LI, which are
essentially bullet points and numbered lists
<p> </p> Paragraph of text. Each new paragraph automatically leaves a little space between the
previous.
<a href=”http://google.com”>Google</a> Anchor tags can be used to make links to other pages, files, images, etc. Note that the
A tag has a “href” attribute, which is used to tell that the anchor tag points to some
other file than itself.
<img src=”logo.png”>
<img src=”http://example.com/logo.png”>
The IMG tag is used for embedding image files into the page, and the “src” attribute is
used to tell which file should be embedded. The example uses a “relative file path” on
the local server, which means that the file should be found in the same folder as the
HTML file with the filename of logo.png. You can also link to pictures on other sites
using a path starting with “http://”, which is known as “hotlinking” and considered bad
practice. Note that the IMG tag does not have a separate end tag.
HTML primer: index.html
<html>
<head>
<title>Google</title>
<link rel="stylesheet" type="text/css" href="/style/style.css">
</head>
<body>
<h1>Main heading</h1>
<ul>
<li>Home</li>
<li>About</li>
</ul>
<p>Paragraph text</p>
</body>
</html>
Declares the document as HTML
Header: helps the browser prime the page before showing any content
Link to CSS file in the header
Closing tag for header and start tag for page
body, which is shown to user
H1 heading tag for the main heading
UL tag for an unordered list and LI tags for
individual list items
P tag for paragraph text
Closing tags for body (visible part of the page) and html tag (which explicitly
tells the browser where the document ends)
Frontend Bentobox
The Browser (=frontend)
The Frontend Bentobox
The Server (=backend)
(i.e. “not frontend” stuff)
Behavior
Style
Content for browsers Content for servers / backend
Photo credits (Creative Commons)
● Gold iPhone 6: http://pl.wikipedia.org/wiki/IPhone#mediaviewer/File:IPhone_6_Gold_Side.png
● Dell rack server: http://it.wikipedia.org/wiki/Rack_(informatica)#mediaviewer/File:Servers_at_LAAS_(FDLS_2007)_0392c.jpg
● Samsung Smart Tv: https://www.flickr.com/photos/samsungtomorrow/7505176858/
● Google Logo: http://commons.wikimedia.org/wiki/File:Googlelogo.png

Weitere ähnliche Inhalte

Was ist angesagt?

Ultimate Skills Checklist for Your First Front-End Developer Job
Ultimate Skills Checklist for Your First Front-End Developer JobUltimate Skills Checklist for Your First Front-End Developer Job
Ultimate Skills Checklist for Your First Front-End Developer Job
Brenna Van Norman
 
Introdution to HTML 5
Introdution to HTML 5Introdution to HTML 5
Introdution to HTML 5
onkar_bhosle
 
Basics of css and xhtml
Basics of css and xhtmlBasics of css and xhtml
Basics of css and xhtml
sagaroceanic11
 
HTML5 New Features and Resources
HTML5 New Features and ResourcesHTML5 New Features and Resources
HTML5 New Features and Resources
Ron Reiter
 
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
ijceronline
 

Was ist angesagt? (20)

HTML 5 Overview
HTML 5 OverviewHTML 5 Overview
HTML 5 Overview
 
HTML5 and XHTML2
HTML5 and XHTML2HTML5 and XHTML2
HTML5 and XHTML2
 
Ultimate Skills Checklist for Your First Front-End Developer Job
Ultimate Skills Checklist for Your First Front-End Developer JobUltimate Skills Checklist for Your First Front-End Developer Job
Ultimate Skills Checklist for Your First Front-End Developer Job
 
The Future of the Web: HTML5
The Future of the Web: HTML5The Future of the Web: HTML5
The Future of the Web: HTML5
 
Web architecture - overview of techniques.
Web architecture - overview of  techniques.Web architecture - overview of  techniques.
Web architecture - overview of techniques.
 
HTML5 and Search Engine Optimization (SEO)
HTML5 and Search Engine Optimization (SEO)HTML5 and Search Engine Optimization (SEO)
HTML5 and Search Engine Optimization (SEO)
 
Introdution to HTML 5
Introdution to HTML 5Introdution to HTML 5
Introdution to HTML 5
 
Internet programming notes
Internet programming notesInternet programming notes
Internet programming notes
 
Web development
Web developmentWeb development
Web development
 
HTML literals, the JSX of the platform
HTML literals, the JSX of the platformHTML literals, the JSX of the platform
HTML literals, the JSX of the platform
 
Basics of css and xhtml
Basics of css and xhtmlBasics of css and xhtml
Basics of css and xhtml
 
HTML5
HTML5HTML5
HTML5
 
Introduction to HTML5/CSS3 In Drupal 7
Introduction to HTML5/CSS3 In Drupal 7Introduction to HTML5/CSS3 In Drupal 7
Introduction to HTML5/CSS3 In Drupal 7
 
HTML5 & CSS3 in Drupal (on the Bayou)
HTML5 & CSS3 in Drupal (on the Bayou)HTML5 & CSS3 in Drupal (on the Bayou)
HTML5 & CSS3 in Drupal (on the Bayou)
 
HTML5 New Features and Resources
HTML5 New Features and ResourcesHTML5 New Features and Resources
HTML5 New Features and Resources
 
Grade 10 COMPUTER
Grade 10 COMPUTERGrade 10 COMPUTER
Grade 10 COMPUTER
 
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
 
Webcomponents TLV October 2014
Webcomponents TLV October 2014Webcomponents TLV October 2014
Webcomponents TLV October 2014
 
BP304 - Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
BP304 - Blog It Up, Baby! Extending the new IBM Lotus Domino Blog TemplateBP304 - Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
BP304 - Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
 
HTML5: features with examples
HTML5: features with examplesHTML5: features with examples
HTML5: features with examples
 

Andere mochten auch (8)

Ajax and JavaScript mit Ruby on Rails
Ajax and JavaScript mit Ruby on RailsAjax and JavaScript mit Ruby on Rails
Ajax and JavaScript mit Ruby on Rails
 
HTML 5 & CSS 3
HTML 5 & CSS 3HTML 5 & CSS 3
HTML 5 & CSS 3
 
Html 5 in a big nutshell
Html 5 in a big nutshellHtml 5 in a big nutshell
Html 5 in a big nutshell
 
Web application architecture
Web application architectureWeb application architecture
Web application architecture
 
Architecture of a Modern Web App
Architecture of a Modern Web AppArchitecture of a Modern Web App
Architecture of a Modern Web App
 
Introduction to Web Architecture
Introduction to Web ArchitectureIntroduction to Web Architecture
Introduction to Web Architecture
 
Slideshare Powerpoint presentation
Slideshare Powerpoint presentationSlideshare Powerpoint presentation
Slideshare Powerpoint presentation
 
State of the Word 2011
State of the Word 2011State of the Word 2011
State of the Word 2011
 

Ähnlich wie Rails Girls - Introduction to HTML & CSS

The Factors For The Website
The Factors For The WebsiteThe Factors For The Website
The Factors For The Website
Julie May
 
Is it time to start using HTML 5
Is it time to start using HTML 5Is it time to start using HTML 5
Is it time to start using HTML 5
Ravi Raj
 
MINOR PROZECT REPORT on WINDOWS SERVER
MINOR PROZECT REPORT on WINDOWS SERVERMINOR PROZECT REPORT on WINDOWS SERVER
MINOR PROZECT REPORT on WINDOWS SERVER
Asish Verma
 

Ähnlich wie Rails Girls - Introduction to HTML & CSS (20)

Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development
 
Front End Lecture 1.pptx
Front End Lecture 1.pptxFront End Lecture 1.pptx
Front End Lecture 1.pptx
 
Iwt module 1
Iwt  module 1Iwt  module 1
Iwt module 1
 
Html5 deciphered - designing concepts part 1
Html5 deciphered - designing concepts part 1Html5 deciphered - designing concepts part 1
Html5 deciphered - designing concepts part 1
 
The Factors For The Website
The Factors For The WebsiteThe Factors For The Website
The Factors For The Website
 
Decoding the Web
Decoding the WebDecoding the Web
Decoding the Web
 
HTML.pptx
HTML.pptxHTML.pptx
HTML.pptx
 
Is it time to start using HTML 5
Is it time to start using HTML 5Is it time to start using HTML 5
Is it time to start using HTML 5
 
Day1
Day1Day1
Day1
 
Michael(tm) Smith: HTML5 at Web Directions South 2008
Michael(tm) Smith: HTML5 at Web Directions South 2008Michael(tm) Smith: HTML5 at Web Directions South 2008
Michael(tm) Smith: HTML5 at Web Directions South 2008
 
Wa html5-pdf
Wa html5-pdfWa html5-pdf
Wa html5-pdf
 
Wa html5-pdf
Wa html5-pdfWa html5-pdf
Wa html5-pdf
 
Full Stack Development Course in Gurgaon
Full Stack Development Course in GurgaonFull Stack Development Course in Gurgaon
Full Stack Development Course in Gurgaon
 
Making Of PHP Based Web Application
Making Of PHP Based Web ApplicationMaking Of PHP Based Web Application
Making Of PHP Based Web Application
 
HTML5 introduction for beginners
HTML5 introduction for beginnersHTML5 introduction for beginners
HTML5 introduction for beginners
 
Websites Unlimited - Pay Monthly Websites
Websites Unlimited - Pay Monthly WebsitesWebsites Unlimited - Pay Monthly Websites
Websites Unlimited - Pay Monthly Websites
 
Web Programming introduction
Web Programming introductionWeb Programming introduction
Web Programming introduction
 
Vskills angular js sample material
Vskills angular js sample materialVskills angular js sample material
Vskills angular js sample material
 
Web Engineering UNIT III as per RGPV Syllabus
Web Engineering UNIT III as per RGPV SyllabusWeb Engineering UNIT III as per RGPV Syllabus
Web Engineering UNIT III as per RGPV Syllabus
 
MINOR PROZECT REPORT on WINDOWS SERVER
MINOR PROZECT REPORT on WINDOWS SERVERMINOR PROZECT REPORT on WINDOWS SERVER
MINOR PROZECT REPORT on WINDOWS SERVER
 

Kürzlich hochgeladen

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Kürzlich hochgeladen (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Rails Girls - Introduction to HTML & CSS

  • 1. A Rails Girls Introduction to HTML & CSS Rails Girls Helsinki, Finland, Spring 2015 Timo Herttua & Vesa Vänskä
  • 2. Agenda 1. Why HTML & CSS are crucial in life? 2. Why HTML & CSS are crucial in RG? 3. Bonus: Why to learn them already today and not tomorrow 4. Division of Labor on the Internet 5. The Front-end Bentobox 6. Live demo: Codeacademy 7. Extra credit exercise 8. Appendix: instructions, HTML primer, Frontend Bentobox
  • 3. Why HTML & CSS ● Perhaps the single most important, and easiest to grasp entry point to the world of web tech ○ WYSIVCTWYG or “What you see is very close to what you get” ● Many of today’s professional developers started with making websites ● The other entry point you typically hear is computer graphics (CG) and/or games (i.e. the Finnish Demoscene*) – which are much more difficult to make than websites ● The third, and perhaps hardest entry point, is tinkering with hardware (e.g. Commodore, Amiga, Arduino, Raspberry Pi, drones, robots, etc.), because of so many moving parts and “low level” programming languages involved *Wikipedia article about the Demoscene: http://en.wikipedia.org/wiki/Demoscene; A Finnish TV series about the Demoscene: http://areena.yle. fi/tv/demoscene; Grand Cru’s account of the Demoscene: http://grandcrugames.com/2013/03/what-the-hll-is-in-the-water-of-finland/
  • 4. HTML & CSS in the Internet ● Close to everything you see on the internet is a combination of HTML, CSS & JavaScript ● Even some apps on iOS & Andoid are made with them (e.g. Facebook’s first gen mobile) ● Web browser is the universal app that everyone has ● HTML, CSS & JS are the language of the web, and the web browsers ● HTML, CSS & JS are open source standards, meaning that no plugins are required to run them
  • 5. Role of HTML & CSS in Rails Girls ● Rails Girls is an introduction to (web application) technology ● Rails in Rails Girls refers to “Ruby on Rails”, a popular web application programming framework (Rails) built with the Ruby programming language ● Web applications are pieces of software that dynamically generate HTML pages that make further use of CSS and JavaScript to make them more visually pleasing and interactive
  • 6. Today: HTML; tomorrow: (among other things) dynamic generation of HTML ● Web applications are used to transmit and transform information by dynamically generating HTML based on user inputs (e.g. Facebook’s chat) ● In order to understand web applications, you need to understand HTML ● In order to make web applications pretty, you need CSS ● In order to make web applications more interactive / responsive, you need JavaScript
  • 7. A bonus “why” ● By engaging with HTML & CSS today, you’ll increase your chances of getting access to a personal coach for a 3-6 month period to help you enter the world of web tech in great company! ● Details on how exactly, stay tuned for more info later in the presentation
  • 8. What is a website made of? ● An HTML page is ○ a structured text file with hyperlinks ■ to other HTML pages ■ to assets, such as ● embedded files, that the browser can display, such as ○ images ○ videos ○ audio ● CSS stylesheets ● script files (JavaScript) ● downloadable files such as PDF’s,
  • 9. A website, “visually” <html> <head> <title>Google</title> <link rel="stylesheet" type="text/css" href=" /style/style.css"> </head> <body> <div id="logo" style="/images/logo.png"></div> <input id="keywords"> <button id="search">Google Search</button> <button id="lucky">I'm Feeling Lucky</button> </body> </html> HTML: http://www.google.com/index.html or just http://google.com body { background-color: white; } button { background-color: light grey; } Stylesheet: style.css Google logo: logo.png
  • 10. Connected devices such as smart TV’s Clients and servers Server (a.k.a backend a.k.a. the cloud) Desktop web browser Mobile device web browser & embedded browsers in “hybrid apps” Client (a.k.a frontend) examples: The cloud (=many servers someone else like Amazon or Google owns, priced per usage per month, not per physical server) Structured data (HTML, JSON, XML, …)
  • 11. HTTP request - response cycle Browser Server 1. Request to http://google.com 2. Server decides what it wants to respond Web page 3. The response tells the browser what to show in the browser 4. The browser renders the page
  • 12. Division of labor on the Internet For browsers: HTML <h1>This is a heading</h1> <p>This is a paragraph</p> <img src=”cat_picture.gif” /> <video><source src=" cat_video.mp4" type="video/mp4"></video> For JS / servers: JSON / XML {“presenters”: [{“id”: 1, “name”: “Vesa”}, {“id”: 2, “name”: “Timo”}]} Structured content CSS body { background-color: red; }; JavaScript confirm(“Are you ready for some cat vids?”); // OK or Cancel Adobe Flash Microsoft Silverlight ... The Browser (=frontend) (e.g. Chrome, Firefox, Safari, ..) Style & behavior Rails, CakePHP, Django, Spring Ruby, PHP, Python, Java Frameworks (=productivity tools by programmers for programmers) Languages (=ways to instruct machines) The Server (=backend) (proprietary) Browser plugins
  • 13. What was all that Confucianism? The Rails Girls workshop uses the Bentobox model to make the world of tech more approachable by helping you attach meaning to the many acronyms of tech (HTML, JS, CSS, etc.) Read more: http://blog.railsgirls.com/post/20405930015/bentobox-learn-the-language-of-technology
  • 14. Using the Bentobox today Frontend Bentobox Backend (tomorrow’s subject)
  • 15. Frontend Bentobox The Browser (=frontend) The Frontend Bentobox The Server (=backend) (i.e. “not frontend” stuff) Behavior Style Content for browsers Content for servers / backend
  • 16. Frontend Bentobox The Browser (=frontend) The Frontend Bentobox: acronyms The Server (=backend) (i.e. “not frontend” stuff) Behavior Style Content for browsers Content for servers / backend HTML <h1>This is a heading</h1> <p>This is a paragraph</p> <img src=”cat_picture.gif” /> <video><source src=" cat_video.mp4" type="video/mp4"></video> CSS body { background-color: red; }; JavaScript confirm(“Are you ready for some cat vids?”); // OK or Cancel JSON / XML {“presenters”: [{“id”: 1, “name”: “Vesa”}, {“id”: 2, “name”: “Timo”}]} Ruby Rails MongoDB Hadoop Backbone Bacon.js
  • 17. Frontend Bentobox The Browser (=frontend) The Frontend Bentobox: tasks The Server (=backend) (i.e. “not frontend” stuff) Behavior Style Content for browsers Content for servers / backend Display a picture of a kitteh Make the background red Confirm that the user actually wants to delete a file Transfer World Bank statistics needed to determine relationship of GDP and birth rate Perform serious data crunching on which kitteh should be shown to which user
  • 18. Frontend Bentobox Exercise: acronyms & tasks Rules: Figure out the term and place it on the bentobox in the right place. There might be false friends and doubles. Googling allowed! ● HTML ● JavaScript ● PHP ● EcmaScript ● CSS ● Java ● jQuery ● Angular ● JSON ● Ember ● XML ● Rails ● Make the font size bigger ● Have a chat app show new messages without having to refresh the page ● Show an ordered list of items (e.g. todo list) Acronyms Tasks
  • 19. Live demo: HTML & CSS on Codecademy.com Let’s look at the first exercise, “HTML Basics”: http://www.codecademy.com/en/tracks/web
  • 20. Extra credit exercise: earn a badge! ● Option 1: CodeSchool.com video course https://www. codeschool.com/courses/front-end-foundations (requires a free signup, the part about HTML is free) ● Option 2: Codecademy.com text-based course http: //www.codecademy.com/en/tracks/web (requires a free signup, the whole course is free) ● For extra credit: ○ Post a link to your badge(s) here (see appendix for instructions): https://docs.google.com/a/efekta.fi/forms/d/1DlXmnyicUvmvprjipXTyBdALoymksF1b9irtv5TDLPc/viewform
  • 22. Extra Credit Instructions: How to find the URLs to badges http://www.codecademy.com/users/username/achievements CodeCademy.comCodeSchool.com https://www.codeschool.com/users/12345
  • 23. HTML primer: principles ● HTML documents are a set of nested “tags” which declare the structure of a document ○ e.g. <p>This is a paragraph of text</p> ● Most tags have a starting tag (<[tag]>) and an ending tag (</[tag]>) ● Tags can be nested inside each other, e.g.
  • 24. HTML “hello world”, or a very simple example – open up a text editor*, save to index.html and open with a web browser <body> <h1>Hello Rails Girls!</h1> <h2>Menu</h2> <ul> <li><a href=”about.html”>About</a></li> </ul> <p>If you paste this into a text file and save it as index. html, it should work if you open it in your browser.</p> </body> * text editor is a (desktop) application that edits plain text files, for example HTML, CSS, JavaScript and Ruby. Examples of free text editors are: https://atom.io/ http://www.sublimetext.com/ or http: //brackets.io/
  • 25. HTML primer: basic tags <html> </html> HTML tags declare the file is an HTML document. Everything else is nested inside these tags. <h1> </h1> <h2> </h2> Heading tags (H1, H2, H3, H4, ..) are meant for declaring different levels (H1 is more important than H2) of headings <ul> <li></li> </ul> <ol> <li></li> </ol> UL (unordered list) and OL (ordered list) declare lists of list items, LI, which are essentially bullet points and numbered lists <p> </p> Paragraph of text. Each new paragraph automatically leaves a little space between the previous. <a href=”http://google.com”>Google</a> Anchor tags can be used to make links to other pages, files, images, etc. Note that the A tag has a “href” attribute, which is used to tell that the anchor tag points to some other file than itself. <img src=”logo.png”> <img src=”http://example.com/logo.png”> The IMG tag is used for embedding image files into the page, and the “src” attribute is used to tell which file should be embedded. The example uses a “relative file path” on the local server, which means that the file should be found in the same folder as the HTML file with the filename of logo.png. You can also link to pictures on other sites using a path starting with “http://”, which is known as “hotlinking” and considered bad practice. Note that the IMG tag does not have a separate end tag.
  • 26. HTML primer: index.html <html> <head> <title>Google</title> <link rel="stylesheet" type="text/css" href="/style/style.css"> </head> <body> <h1>Main heading</h1> <ul> <li>Home</li> <li>About</li> </ul> <p>Paragraph text</p> </body> </html> Declares the document as HTML Header: helps the browser prime the page before showing any content Link to CSS file in the header Closing tag for header and start tag for page body, which is shown to user H1 heading tag for the main heading UL tag for an unordered list and LI tags for individual list items P tag for paragraph text Closing tags for body (visible part of the page) and html tag (which explicitly tells the browser where the document ends)
  • 27. Frontend Bentobox The Browser (=frontend) The Frontend Bentobox The Server (=backend) (i.e. “not frontend” stuff) Behavior Style Content for browsers Content for servers / backend
  • 28. Photo credits (Creative Commons) ● Gold iPhone 6: http://pl.wikipedia.org/wiki/IPhone#mediaviewer/File:IPhone_6_Gold_Side.png ● Dell rack server: http://it.wikipedia.org/wiki/Rack_(informatica)#mediaviewer/File:Servers_at_LAAS_(FDLS_2007)_0392c.jpg ● Samsung Smart Tv: https://www.flickr.com/photos/samsungtomorrow/7505176858/ ● Google Logo: http://commons.wikimedia.org/wiki/File:Googlelogo.png