SlideShare a Scribd company logo
1 of 36
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 conflict, who wins?
A: The more “specific” selector.
•   Specificity 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 defined “last” wins

•   Details here
CSS
[laying out your pages]
TWO CAVEATS


(1) This stuff is confusing


(2) Muddling through & experimentation are
okay!
•   We’re 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 flows 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 floating object

•   Can be applied to any object, regardless of it’s float

•   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. floating point
   •   “Floating point” => decimal
STRINGS




Intuitively, a string is text
   •   []
BOOLEANS




Boolean is a fancy way of saying true or false
BUZZZZWORD



DRY => “Don’t Repeat Yourself”
•   Staying DRY is about efficiency and clarity

•   If you find yourself typing the same thing over and over, ask yourself
    whether you can dry off

•   Ways you’ll 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

More Related Content

Similar to week2

CSS workshop @ OutSystems
CSS workshop @ OutSystemsCSS workshop @ OutSystems
CSS workshop @ OutSystemsRuben Goncalves
 
An Introduction To Python - Variables, Math
An Introduction To Python - Variables, MathAn Introduction To Python - Variables, Math
An Introduction To Python - Variables, MathBlue Elephant Consulting
 
Data visualization tools & techniques - 1
Data visualization tools & techniques - 1Data visualization tools & techniques - 1
Data visualization tools & techniques - 1Korivi Sravan Kumar
 
Intro to html, css & sass
Intro to html, css & sassIntro to html, css & sass
Intro to html, css & sassSean Wolfe
 
Journey To The Front End World - Part2 - The Cosmetic
Journey To The Front End World - Part2 - The  CosmeticJourney To The Front End World - Part2 - The  Cosmetic
Journey To The Front End World - Part2 - The CosmeticIrfan Maulana
 
Bill howe 6_machinelearning_1
Bill howe 6_machinelearning_1Bill howe 6_machinelearning_1
Bill howe 6_machinelearning_1Mahammad Valiyev
 
Concept of Object-Oriented in C++
Concept of Object-Oriented in C++Concept of Object-Oriented in C++
Concept of Object-Oriented in C++Abdullah Jan
 
Getting started in Python presentation by Laban K
Getting started in Python presentation by Laban KGetting started in Python presentation by Laban K
Getting started in Python presentation by Laban KGDSCKYAMBOGO
 
[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOPMuhammad 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 2014Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014
Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014Christian Lilley
 
Getting Started With CSS
Getting Started With CSSGetting Started With CSS
Getting Started With CSSTrisha Crowley
 
Excel 2016 VBA PPT Slide Deck - For Basic to Adavance VBA Learning
Excel 2016 VBA PPT Slide Deck - For Basic to Adavance VBA LearningExcel 2016 VBA PPT Slide Deck - For Basic to Adavance VBA Learning
Excel 2016 VBA PPT Slide Deck - For Basic to Adavance VBA LearningPrantikMaity6
 
Clean Code - 2
Clean Code - 2Clean Code - 2
Clean Code - 2Don Kim
 
Code Like Pythonista
Code Like PythonistaCode Like Pythonista
Code Like PythonistaChiyoung Song
 
Programming Language
Programming  LanguageProgramming  Language
Programming LanguageAdeel Hamid
 
Types Working for You, Not Against You
Types Working for You, Not Against YouTypes Working for You, Not Against You
Types Working for You, Not Against YouC4Media
 
CSS for basic learner
CSS for basic learnerCSS for basic learner
CSS for basic learnerYoeung Vibol
 

Similar to week2 (20)

CSS workshop @ OutSystems
CSS workshop @ OutSystemsCSS workshop @ OutSystems
CSS workshop @ OutSystems
 
Introduction to c ++ part -1
Introduction to c ++   part -1Introduction to c ++   part -1
Introduction to c ++ part -1
 
An Introduction To Python - Variables, Math
An Introduction To Python - Variables, MathAn Introduction To Python - Variables, Math
An Introduction To Python - Variables, Math
 
Data visualization tools & techniques - 1
Data visualization tools & techniques - 1Data visualization tools & techniques - 1
Data visualization tools & techniques - 1
 
Intro to html, css & sass
Intro to html, css & sassIntro to html, css & sass
Intro to html, css & sass
 
Journey To The Front End World - Part2 - The Cosmetic
Journey To The Front End World - Part2 - The  CosmeticJourney To The Front End World - Part2 - The  Cosmetic
Journey To The Front End World - Part2 - The Cosmetic
 
Bill howe 6_machinelearning_1
Bill howe 6_machinelearning_1Bill howe 6_machinelearning_1
Bill howe 6_machinelearning_1
 
Concept of Object-Oriented in C++
Concept of Object-Oriented in C++Concept of Object-Oriented in C++
Concept of Object-Oriented in C++
 
CSC PPT 9.pptx
CSC PPT 9.pptxCSC PPT 9.pptx
CSC PPT 9.pptx
 
Getting started in Python presentation by Laban K
Getting started in Python presentation by Laban KGetting started in Python presentation by Laban K
Getting started in Python presentation by Laban K
 
[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP
 
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 2014Scalable 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
 
Getting Started With CSS
Getting Started With CSSGetting Started With CSS
Getting Started With CSS
 
Excel 2016 VBA PPT Slide Deck - For Basic to Adavance VBA Learning
Excel 2016 VBA PPT Slide Deck - For Basic to Adavance VBA LearningExcel 2016 VBA PPT Slide Deck - For Basic to Adavance VBA Learning
Excel 2016 VBA PPT Slide Deck - For Basic to Adavance VBA Learning
 
Design Without Types
Design Without TypesDesign Without Types
Design Without Types
 
Clean Code - 2
Clean Code - 2Clean Code - 2
Clean Code - 2
 
Code Like Pythonista
Code Like PythonistaCode Like Pythonista
Code Like Pythonista
 
Programming Language
Programming  LanguageProgramming  Language
Programming Language
 
Types Working for You, Not Against You
Types Working for You, Not Against YouTypes Working for You, Not Against You
Types Working for You, Not Against You
 
CSS for basic learner
CSS for basic learnerCSS for basic learner
CSS for basic learner
 

Recently uploaded

General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 

Recently uploaded (20)

General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 

week2

  • 1.
  • 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 conflict, who wins? A: The more “specific” selector. • Specificity 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 defined “last” wins • Details here
  • 14. TWO CAVEATS (1) This stuff is confusing (2) Muddling through & experimentation are okay! • We’re 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 flows 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 floating object • Can be applied to any object, regardless of it’s float • 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. floating point • “Floating point” => decimal
  • 29. BOOLEANS Boolean is a fancy way of saying true or false
  • 30. BUZZZZWORD DRY => “Don’t Repeat Yourself” • Staying DRY is about efficiency and clarity • If you find yourself typing the same thing over and over, ask yourself whether you can dry off • Ways you’ll 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

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n