際際滷

際際滷Share a Scribd company logo
week2
LESSON TWO
Front End Development
HTML
[review]
ANATOMY OF A TAG

(1) Opening & closing =>
<tag_name attr_1=val_1   [...]   attr_n=val_n >

         [...]

</tag_name>

Ex:
ANATOMY OF A TAG


(2) Self-closing =>
<tag_name attr_1=val_1 [...] attr_n=val_n   />

Ex:
15 TAGS YOU MUST KNOW
(1) div

(2) a

(3) p

(4) img (self-closing)

(5) ol + li

(6) ul + li

(7) form + input + select

(8) br (self-closing)
15 TAGS YOU MUST KNOW

(9) span

(10) h1...h6

(11) html, head, body

(12) meta

(13) script

(14) style

(15) link
CSS
[review]
ANATOMY OF A SELECTOR

(1) Select by tag name
tag_name {

      style_1: value_1;
      [ ... ]
      style_n: value_n;
}

Ex:

p {

      color: #000;
      font-size: 12px;
}
ANATOMY OF A SELECTOR
(2) Select by class
.class {

      style_1: value_1;
      [ ... ]
      style_n: value_n;
}

Ex:

.highlight {

      font-weight: bold;
      font-size: 14px;
}
ANATOMY OF A SELECTOR

(3) Select by id
#id {

      style_1: value_1;
      [ ... ]
      style_n: value_n;
}

Ex:

#footer p {

      font-size: 9px;
}
PRECEDENCE

Q: When two selectors con鍖ict, who wins?
A: The more specific selector.
   Speci鍖city determined by tallying the ids, classes, and tags
    comprising a selector

   Inline >> id >> classes >> tag

   Hierarchy is classified in the sense that 1 id beats 1,000 classes, 1
    class beats 1,000 tags, and inline trumps all

   In case of a tie, the one de鍖ned last wins

   Details here
CSS
[laying out your pages]
TWO CAVEATS


(1) This stuff is confusing


(2) Muddling through & experimentation are
okay!
   Were experts at this technique

   Ours are not necessarily best practices
DEFAULTS


Differ across browsers => use a reset
     E.g., Blueprint CSS

     Provides you with a common starting point

Resets create default settings like:
     Align everything to the left

     Divs are block level elements

     No padding, no margin, no border, anywhere
SPACING & THE BOX MODEL
Think of HTML elements as boxes. Each box has (1) content, (2) padding
(optionally), (3) a border (optionally), and (4) margin (optionally)
BLOCK LEVEL VS. INLINE

Block level => intuitively, blocks of
content
   Starts a new line (before and after)

   Has a width

   By default, spans the entire width of their containing element

   CSS: display: block

   Block level elements: div, h1 - h6, p, ul, ol, li, table, tr, td, th,
    blockquote
BLOCK LEVEL VS. INLINE


Inline => intuitively, displayed inline
   Does NOT start a new line (before or after)

   Does NOT have a width

   Takes up only as much space as necessary

   CSS: display: inline

   Inline elements: i, b, a, em, strong, q
FLOAT & CLEAR


Float => floats an element to left or right
   Values: inherit, left, right, none

   Floats to left or right of container element.

   Content 鍖ows around to side, down and around

   Ignores display block or display in-line

   Needs a defined width
FLOAT & CLEAR


               China has a carefully thought out
               and strategic plan to take over
               America We took the Bible and prayer
               out of public schools, and now were
               having weekly shootings practically.
               The American Left hates Christendom.
They hate Western civilization. I am a firm believer
in intelligent design as a matter of faith and
intellect. I believe intelligent design should be
presented in schools alongside the theories of
evolution. The exact phrase separation of Church and
State came out of Adolph Hitlers mouth, thats where it
comes from.
FLOAT & CLEAR



Clear => allow elements to float on sides?
   Values: inherit, left, right, none

   If set, does not render until beneath previous 鍖oating object

   Can be applied to any object, regardless of its 鍖oat

   Does not naturally inherit down to children
FLOAT & CLEAR


                        same text, with clear:left


China has a carefully thought out and strategic plan
to take over America We took the Bible and prayer out
of public schools, and now were having weekly
shootings practically. The American Left hates
Christendom. They hate Western civilization. I am a
firm believer in intelligent design as a matter of
faith and intellect. I believe intelligent design
should be presented in schools alongside the theories
of evolution. The exact phrase separation of Church
and State came out of Adolph Hitlers mouth, thats
where it comes from.
Fixed and Absolute Positioning




           demo
JAVASCRIPT
[language basics]
DATA TYPES




        Javascript
      [language basics]
DATA TYPES
    Must interact with Javascript on its own terms
    It divides the world into six fundamental
    categories:
   (1) Numbers

   (2) Strings

   (3) Booleans

   (4) Functions

   (5) Objects

   (6) Undefined
NUMBERS & ARITHMETIC


Can do all your basic arithmetic in Javascript
Order of operations matters (as always)
      Use parentheses for clarity

Integer vs. 鍖oating point
      Floating point => decimal
STRINGS




Intuitively, a string is text
      []
BOOLEANS




Boolean is a fancy way of saying true or false
BUZZZZWORD



DRY => Dont Repeat Yourself
   Staying DRY is about efficiency and clarity

   If you 鍖nd yourself typing the same thing over and over, ask yourself
    whether you can dry off

   Ways youll learn to stay dry: (1) variables, (2) functions, (3)
    modules
VARIABLES


Store data with an arbitrary name


var name;
name = 17;
console.log(name); // => 17
ASSIGNMENT VS. EQUALITY

== != = -Charlie Croom
=
       This is a command

       Sets the value of a variable

== and ===
       These are tests

       Return Booleans (true or false)
FUNCTIONS


The ultimate DRY

Encapsulate common functionality
function name( arg_1, ... arg_n ) {

    [ FUNCTION BODY ]

}
BASIC SYNTAX




Lines end with a semicolon
Group code with braces: {}
CONTROL FLOW



if
for
while
QUESTIONS?
contact will_and_bay@hackyale.com
Ad

Recommended

Week2
Week2
Will Gaybrick
An Introduction to CSS
An Introduction to CSS
John Catterfeld
Hardcore CSS
Hardcore CSS
PDX Web & Design
OOP CSS Presenation
OOP CSS Presenation
RobotDeathSquad
FFW Gabrovo PMG - JavaScript 1
FFW Gabrovo PMG - JavaScript 1
Toni Kolev
FFW Gabrovo PMG - jQuery
FFW Gabrovo PMG - jQuery
Toni Kolev
Pj01 x-classes and objects
Pj01 x-classes and objects
SasidharaRaoMarrapu
Week 1 (v3)
Week 1 (v3)
Will Gaybrick
CSS workshop @ OutSystems
CSS workshop @ OutSystems
Ruben Goncalves
Introduction to c ++ part -1
Introduction to c ++ part -1
baabtra.com - No. 1 supplier of quality freshers
An Introduction To Python - Variables, Math
An Introduction To Python - Variables, Math
Blue Elephant Consulting
Data visualization tools & techniques - 1
Data visualization tools & techniques - 1
Korivi Sravan Kumar
Intro to html, css & sass
Intro to html, css & sass
Sean Wolfe
Journey To The Front End World - Part2 - The Cosmetic
Journey To The Front End World - Part2 - The Cosmetic
Irfan Maulana
Bill howe 6_machinelearning_1
Bill howe 6_machinelearning_1
Mahammad Valiyev
Object Oriented Programming Class and Objects
Object Oriented Programming Class and Objects
rubini8582
Concept of Object-Oriented in C++
Concept of Object-Oriented in C++
Abdullah Jan
CSC PPT 9.pptx
CSC PPT 9.pptx
DrRavneetSingh
CSS is the language we use to style a Web page. CSS stands for Cascading Styl...
CSS is the language we use to style a Web page. CSS stands for Cascading Styl...
ssuser6478a8
Getting started in Python presentation by Laban K
Getting started in Python presentation by Laban K
GDSCKYAMBOGO
[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP
Muhammad Hammad Waseem
Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014
Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014
Christian Lilley
Getting Started With CSS
Getting Started With CSS
Trisha Crowley
Excel 2016 VBA PPT 際際滷 Deck - For Basic to Adavance VBA Learning
Excel 2016 VBA PPT 際際滷 Deck - For Basic to Adavance VBA Learning
PrantikMaity6
Design Without Types
Design Without Types
Alexandru Bolboaca
Clean Code - 2
Clean Code - 2
Don Kim
Code Like Pythonista
Code Like Pythonista
Chiyoung Song
Programming Language
Programming Language
Adeel Hamid
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
Arshad Shaikh
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S

More Related Content

Similar to week2 (20)

CSS workshop @ OutSystems
CSS workshop @ OutSystems
Ruben Goncalves
Introduction to c ++ part -1
Introduction to c ++ part -1
baabtra.com - No. 1 supplier of quality freshers
An Introduction To Python - Variables, Math
An Introduction To Python - Variables, Math
Blue Elephant Consulting
Data visualization tools & techniques - 1
Data visualization tools & techniques - 1
Korivi Sravan Kumar
Intro to html, css & sass
Intro to html, css & sass
Sean Wolfe
Journey To The Front End World - Part2 - The Cosmetic
Journey To The Front End World - Part2 - The Cosmetic
Irfan Maulana
Bill howe 6_machinelearning_1
Bill howe 6_machinelearning_1
Mahammad Valiyev
Object Oriented Programming Class and Objects
Object Oriented Programming Class and Objects
rubini8582
Concept of Object-Oriented in C++
Concept of Object-Oriented in C++
Abdullah Jan
CSC PPT 9.pptx
CSC PPT 9.pptx
DrRavneetSingh
CSS is the language we use to style a Web page. CSS stands for Cascading Styl...
CSS is the language we use to style a Web page. CSS stands for Cascading Styl...
ssuser6478a8
Getting started in Python presentation by Laban K
Getting started in Python presentation by Laban K
GDSCKYAMBOGO
[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP
Muhammad Hammad Waseem
Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014
Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014
Christian Lilley
Getting Started With CSS
Getting Started With CSS
Trisha Crowley
Excel 2016 VBA PPT 際際滷 Deck - For Basic to Adavance VBA Learning
Excel 2016 VBA PPT 際際滷 Deck - For Basic to Adavance VBA Learning
PrantikMaity6
Design Without Types
Design Without Types
Alexandru Bolboaca
Clean Code - 2
Clean Code - 2
Don Kim
Code Like Pythonista
Code Like Pythonista
Chiyoung Song
Programming Language
Programming Language
Adeel Hamid
CSS workshop @ OutSystems
CSS workshop @ OutSystems
Ruben Goncalves
An Introduction To Python - Variables, Math
An Introduction To Python - Variables, Math
Blue Elephant Consulting
Data visualization tools & techniques - 1
Data visualization tools & techniques - 1
Korivi Sravan Kumar
Intro to html, css & sass
Intro to html, css & sass
Sean Wolfe
Journey To The Front End World - Part2 - The Cosmetic
Journey To The Front End World - Part2 - The Cosmetic
Irfan Maulana
Bill howe 6_machinelearning_1
Bill howe 6_machinelearning_1
Mahammad Valiyev
Object Oriented Programming Class and Objects
Object Oriented Programming Class and Objects
rubini8582
Concept of Object-Oriented in C++
Concept of Object-Oriented in C++
Abdullah Jan
CSS is the language we use to style a Web page. CSS stands for Cascading Styl...
CSS is the language we use to style a Web page. CSS stands for Cascading Styl...
ssuser6478a8
Getting started in Python presentation by Laban K
Getting started in Python presentation by Laban K
GDSCKYAMBOGO
[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP
Muhammad Hammad Waseem
Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014
Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014
Christian Lilley
Getting Started With CSS
Getting Started With CSS
Trisha Crowley
Excel 2016 VBA PPT 際際滷 Deck - For Basic to Adavance VBA Learning
Excel 2016 VBA PPT 際際滷 Deck - For Basic to Adavance VBA Learning
PrantikMaity6
Clean Code - 2
Clean Code - 2
Don Kim
Code Like Pythonista
Code Like Pythonista
Chiyoung Song
Programming Language
Programming Language
Adeel Hamid

Recently uploaded (20)

PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
Arshad Shaikh
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
Paper 108 | Thoreaus Influence on Gandhi: The Evolution of Civil Disobedience
Paper 108 | Thoreaus Influence on Gandhi: The Evolution of Civil Disobedience
Rajdeep Bavaliya
Overview of Employee in Odoo 18 - Odoo 際際滷s
Overview of Employee in Odoo 18 - Odoo 際際滷s
Celine George
GEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdf
SHERAZ AHMAD LONE
Introduction to Generative AI and Copilot.pdf
Introduction to Generative AI and Copilot.pdf
TechSoup
How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18
Celine George
Introduction to problem solving Techniques
Introduction to problem solving Techniques
merlinjohnsy
LDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation Sampler
LDM & Mia eStudios
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
JHS SHS Back to School 2024-2025 .pptx
JHS SHS Back to School 2024-2025 .pptx
melvinapay78
How to Manage Multi Language for Invoice in Odoo 18
How to Manage Multi Language for Invoice in Odoo 18
Celine George
How to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 Employee
Celine George
Paper 107 | From Watchdog to Lapdog: Ishiguros Fiction and the Rise of Godi...
Paper 107 | From Watchdog to Lapdog: Ishiguros Fiction and the Rise of Godi...
Rajdeep Bavaliya
2025 June Year 9 Presentation: Subject selection.pptx
2025 June Year 9 Presentation: Subject selection.pptx
mansk2
Plate Tectonic Boundaries and Continental Drift Theory
Plate Tectonic Boundaries and Continental Drift Theory
Marie
Wax Moon, Richmond, VA. Terrence McPherson
Wax Moon, Richmond, VA. Terrence McPherson
TerrenceMcPherson1
The Man In The Back Exceptional Delaware.pdf
The Man In The Back Exceptional Delaware.pdf
dennisongomezk
Overview of Off Boarding in Odoo 18 Employees
Overview of Off Boarding in Odoo 18 Employees
Celine George
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
Arshad Shaikh
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
Paper 108 | Thoreaus Influence on Gandhi: The Evolution of Civil Disobedience
Paper 108 | Thoreaus Influence on Gandhi: The Evolution of Civil Disobedience
Rajdeep Bavaliya
Overview of Employee in Odoo 18 - Odoo 際際滷s
Overview of Employee in Odoo 18 - Odoo 際際滷s
Celine George
GEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdf
SHERAZ AHMAD LONE
Introduction to Generative AI and Copilot.pdf
Introduction to Generative AI and Copilot.pdf
TechSoup
How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18
Celine George
Introduction to problem solving Techniques
Introduction to problem solving Techniques
merlinjohnsy
LDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation Sampler
LDM & Mia eStudios
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
JHS SHS Back to School 2024-2025 .pptx
JHS SHS Back to School 2024-2025 .pptx
melvinapay78
How to Manage Multi Language for Invoice in Odoo 18
How to Manage Multi Language for Invoice in Odoo 18
Celine George
How to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 Employee
Celine George
Paper 107 | From Watchdog to Lapdog: Ishiguros Fiction and the Rise of Godi...
Paper 107 | From Watchdog to Lapdog: Ishiguros Fiction and the Rise of Godi...
Rajdeep Bavaliya
2025 June Year 9 Presentation: Subject selection.pptx
2025 June Year 9 Presentation: Subject selection.pptx
mansk2
Plate Tectonic Boundaries and Continental Drift Theory
Plate Tectonic Boundaries and Continental Drift Theory
Marie
Wax Moon, Richmond, VA. Terrence McPherson
Wax Moon, Richmond, VA. Terrence McPherson
TerrenceMcPherson1
The Man In The Back Exceptional Delaware.pdf
The Man In The Back Exceptional Delaware.pdf
dennisongomezk
Overview of Off Boarding in Odoo 18 Employees
Overview of Off Boarding in Odoo 18 Employees
Celine George
Ad

week2

  • 2. LESSON TWO Front End Development
  • 4. ANATOMY OF A TAG (1) Opening & closing => <tag_name attr_1=val_1 [...] attr_n=val_n > [...] </tag_name> Ex:
  • 5. ANATOMY OF A TAG (2) Self-closing => <tag_name attr_1=val_1 [...] attr_n=val_n /> Ex:
  • 6. 15 TAGS YOU MUST KNOW (1) div (2) a (3) p (4) img (self-closing) (5) ol + li (6) ul + li (7) form + input + select (8) br (self-closing)
  • 7. 15 TAGS YOU MUST KNOW (9) span (10) h1...h6 (11) html, head, body (12) meta (13) script (14) style (15) link
  • 9. ANATOMY OF A SELECTOR (1) Select by tag name tag_name { style_1: value_1; [ ... ] style_n: value_n; } Ex: p { color: #000; font-size: 12px; }
  • 10. ANATOMY OF A SELECTOR (2) Select by class .class { style_1: value_1; [ ... ] style_n: value_n; } Ex: .highlight { font-weight: bold; font-size: 14px; }
  • 11. ANATOMY OF A SELECTOR (3) Select by id #id { style_1: value_1; [ ... ] style_n: value_n; } Ex: #footer p { font-size: 9px; }
  • 12. PRECEDENCE Q: When two selectors con鍖ict, who wins? A: The more specific selector. Speci鍖city determined by tallying the ids, classes, and tags comprising a selector Inline >> id >> classes >> tag Hierarchy is classified in the sense that 1 id beats 1,000 classes, 1 class beats 1,000 tags, and inline trumps all In case of a tie, the one de鍖ned last wins Details here
  • 14. TWO CAVEATS (1) This stuff is confusing (2) Muddling through & experimentation are okay! Were experts at this technique Ours are not necessarily best practices
  • 15. DEFAULTS Differ across browsers => use a reset E.g., Blueprint CSS Provides you with a common starting point Resets create default settings like: Align everything to the left Divs are block level elements No padding, no margin, no border, anywhere
  • 16. SPACING & THE BOX MODEL Think of HTML elements as boxes. Each box has (1) content, (2) padding (optionally), (3) a border (optionally), and (4) margin (optionally)
  • 17. BLOCK LEVEL VS. INLINE Block level => intuitively, blocks of content Starts a new line (before and after) Has a width By default, spans the entire width of their containing element CSS: display: block Block level elements: div, h1 - h6, p, ul, ol, li, table, tr, td, th, blockquote
  • 18. BLOCK LEVEL VS. INLINE Inline => intuitively, displayed inline Does NOT start a new line (before or after) Does NOT have a width Takes up only as much space as necessary CSS: display: inline Inline elements: i, b, a, em, strong, q
  • 19. FLOAT & CLEAR Float => floats an element to left or right Values: inherit, left, right, none Floats to left or right of container element. Content 鍖ows around to side, down and around Ignores display block or display in-line Needs a defined width
  • 20. FLOAT & CLEAR China has a carefully thought out and strategic plan to take over America We took the Bible and prayer out of public schools, and now were having weekly shootings practically. The American Left hates Christendom. They hate Western civilization. I am a firm believer in intelligent design as a matter of faith and intellect. I believe intelligent design should be presented in schools alongside the theories of evolution. The exact phrase separation of Church and State came out of Adolph Hitlers mouth, thats where it comes from.
  • 21. FLOAT & CLEAR Clear => allow elements to float on sides? Values: inherit, left, right, none If set, does not render until beneath previous 鍖oating object Can be applied to any object, regardless of its 鍖oat Does not naturally inherit down to children
  • 22. FLOAT & CLEAR same text, with clear:left China has a carefully thought out and strategic plan to take over America We took the Bible and prayer out of public schools, and now were having weekly shootings practically. The American Left hates Christendom. They hate Western civilization. I am a firm believer in intelligent design as a matter of faith and intellect. I believe intelligent design should be presented in schools alongside the theories of evolution. The exact phrase separation of Church and State came out of Adolph Hitlers mouth, thats where it comes from.
  • 23. Fixed and Absolute Positioning demo
  • 25. DATA TYPES Javascript [language basics]
  • 26. DATA TYPES Must interact with Javascript on its own terms It divides the world into six fundamental categories: (1) Numbers (2) Strings (3) Booleans (4) Functions (5) Objects (6) Undefined
  • 27. NUMBERS & ARITHMETIC Can do all your basic arithmetic in Javascript Order of operations matters (as always) Use parentheses for clarity Integer vs. 鍖oating point Floating point => decimal
  • 29. BOOLEANS Boolean is a fancy way of saying true or false
  • 30. BUZZZZWORD DRY => Dont Repeat Yourself Staying DRY is about efficiency and clarity If you 鍖nd yourself typing the same thing over and over, ask yourself whether you can dry off Ways youll learn to stay dry: (1) variables, (2) functions, (3) modules
  • 31. VARIABLES Store data with an arbitrary name var name; name = 17; console.log(name); // => 17
  • 32. ASSIGNMENT VS. EQUALITY == != = -Charlie Croom = This is a command Sets the value of a variable == and === These are tests Return Booleans (true or false)
  • 33. FUNCTIONS The ultimate DRY Encapsulate common functionality function name( arg_1, ... arg_n ) { [ FUNCTION BODY ] }
  • 34. BASIC SYNTAX Lines end with a semicolon Group code with braces: {}

Editor's Notes