Movatterモバイル変換


[0]ホーム

URL:


Uploaded byThinkful
PDF, PPTX905 views

Frontend Crash Course: HTML and CSS

This document provides an overview of an HTML and CSS crash course, including:- Introductions and goals of learning frontend development concepts - Explanations of HTML tags, elements, and attributes- Explanations of CSS selectors, properties, values, and basic layout techniques- Examples and drills for applying HTML and CSS concepts- A positioning exercise for further practice with CSS layoutThe document guides students through building their first website and provides resources for continuing to learn frontend development on their own.

Embed presentation

Download as PDF, PPTX
Frontend Crash Course:HTML & CSSWifi network: CrossCamp.us Eventshttp://bit.ly/html-css-la
© 2017 Thinkful. All Rights Reserved. 2About usWe train developers and datascientists through 1-on-1mentorship and career prep
© 2017 Thinkful. All Rights Reserved. 3About meNoel DuarteLos Angeles Area General ManagerUC Berkeley ’15 — worked primarily with R forpopulation genetics analysis, at Thinkful since January2016
© 2017 Thinkful. All Rights Reserved. 4About youWhy are you here?I’m interested in becoming a developerI’m just curious about what coding isProgramming experience?First lines of code will be written tonightBeen self teaching for 1-3 monthsBeen at this for 3+ months
© 2017 Thinkful. All Rights Reserved. 5GoalsUnderstand core concepts of using HTML/CSS tobuild websitesComplete drills to put those concepts into practiceBuild your first websiteLearn to learn programming, especially the feeling ofstruggling with a conceptTake home challenges to keep going
© 2017 Thinkful. All Rights Reserved. 6Not goalsExhaustive coverage of HTML elements / CSSselectorsJavaScript programming for interactivityUsing developer tools
© 2017 Thinkful. All Rights Reserved. 7Why learn frontend developmentJob opportunitiesEveryone needs a website. You can build themGood starting place to see if coding is for you
© 2017 Thinkful. All Rights Reserved. 8Client / ServerFront-end developer Back-end developerClient Server
© 2017 Thinkful. All Rights Reserved. 9How that relates to what we’re doingWhen we write HTML & CSS today, we arecreating those files that are stored on aserver, sent through a series of tubes, andthen rendered by your browser
© 2017 Thinkful. All Rights Reserved. 10SetupNormally, developers use a text editor to write codeToday, we’re using a tool called CodepenCodepen lets you write HTML/CSS and instantlysee the results of your workCreate an account: https://codepen.io/accounts/signupOn second page, fill out your info you want to saveyour workCreate a new “pen”
© 2017 Thinkful. All Rights Reserved. 11Your first websiteCopy this (don’t worry if you don’t yet understand):<html><body><h1>Hello world!</h1></body></html>
© 2017 Thinkful. All Rights Reserved. 12What is HTML?HTML is the content andstructure of a webpage
© 2017 Thinkful. All Rights Reserved. 13What is HTML?
© 2017 Thinkful. All Rights Reserved. 14What is HTML?
© 2017 Thinkful. All Rights Reserved. 15What is HTML?HTML is the content and structure of a webpageThree key concepts:TagsElementsAttributes
© 2017 Thinkful. All Rights Reserved. 16HTML TagsEvery tag starts with a “less than” sign and ends with a“greater than” sign<html> This is an HTML tag<body> This is a body tag<h1>Hello world!</h1> This line has two H1tags, one opening and one closing</body></html>
© 2017 Thinkful. All Rights Reserved. 17HTML TagsThere are opening tags and closing tags. Closing tagshave a backslash before the tag name.HTML tags have become more semantic with HTML5(or, the word signals the purpose of the tag). We’llreview some common tags shortly.
© 2017 Thinkful. All Rights Reserved. 18HTML ElementsHTML elements usually consist of an opening tag, closingtag, and some content.<html><body> This element starts here and ends two lines below<h1>Hello world!</h1> This is an HTML element</body></html>Some consist of just a self-closing tag<img src=“http://i.imgur.com/Th5404r.jpg">
© 2017 Thinkful. All Rights Reserved. 19HTML ElementsA non-exhaustive list of HTML elements:<html> HTML tags wrap your entire page<head> Head tags<body> Body tags<h1> H1 tags signify the largest headline. H2signifies subhead… through h6<p> Paragraph tags wrap a paragraph of writing
© 2017 Thinkful. All Rights Reserved. 20HTML Elements<p> Paragraph tags wrap a paragraph of writing<section> Section tags help you organize differentsections of your layout<div> Div tags are generic/non-semantic container tagsfor anything that needs a container<a> Anchor tags are for setting some text to be a link<ul> <li> / <ol><li> Unordered list and ordered lists arefor lists of items, containing list item elements<button> This is a button
© 2017 Thinkful. All Rights Reserved. 21HTML AttributesHTML attributes set properties on an element. They belongin the opening tag. Here are three common attributes:<a href=“https://somewhere.com">This is a link</a> hrefis an attribute for setting the destination of a link<h1 class=“headline”>This is a headline</h1> class is anattribute that doesn’t show up in the rendered webpage,but will be important when we start talking about CSS<h1 id=“headline”>This is a headline</h1> id is anattribute that doesn’t show up in the rendered webpage,but will be important when we start talking about CSS
© 2017 Thinkful. All Rights Reserved. 22HTML DrillsLink here, link there:http://codepen.io/team/thinkful/pen/qNOGmPImages 101: http://codepen.io/team/thinkful/pen/gMaJvqCreating headers: http://codepen.io/team/thinkful/pen/JKGPdWAdd a header element inside of the body (but before themain content). Inside the header, add a title ("Lorem Ipsum")on one line, followed by a subtitle on the next ("Holdingplaces since the 1st century BCE"). The subtitle text shouldbe smaller than the title text.Link here, link there solution: http://codepen.io/team/thinkful/pen/aZNGdPImages 101 solution :http://codepen.io/team/thinkful/pen/OXNZXRCreating headers: http://codepen.io/team/thinkful/pen/KMzRzy
© 2017 Thinkful. All Rights Reserved. 23HTML reviewWhat is HTML?TagsElementsAttributesGoogling HTML elements
© 2017 Thinkful. All Rights Reserved. 24What is CSS?Cascading Style Sheets determine the visualpresentation of your HTML webpages
© 2017 Thinkful. All Rights Reserved. 25What is CSS?Key concepts:SelectorsPropertyValueDeclaration / Declaration blockTwo problems we solve with CSS:Presentation of specific elementsLayout
© 2017 Thinkful. All Rights Reserved. 26CSS Exampleh1 {color: red;font-size: 36px;}
© 2017 Thinkful. All Rights Reserved. 27CSS SelectorsCSS selectors determine which HTML elements are targetedfor specific styles:p This selects all paragraph tags.header This selects HTML elements with the class“header”#navigation This selects HTML elements with the IDnavigationp.header This selects paragraph tags with the headerclassSelectors can be combined.
© 2017 Thinkful. All Rights Reserved. 28CSS PropertiesCSS properties determine what about the appearanceyou’re setting:color This determines the font colorfont-family This lets you set the typeface as well asbackup typefacesbackground-image This lets you set abackground image for an elementheight This lets you set the height of an element
© 2017 Thinkful. All Rights Reserved. 29CSS PropertiesEach property has a default value for a given element.When you write CSS, you over-ride that default valuewith a new value.For a full list, see: http://www.htmldog.com/references/css/properties/
© 2017 Thinkful. All Rights Reserved. 30CSS ValuesEach property has a set of acceptable values that you can set:color: red, blue, green, #CCCCCC These are all acceptablevalues for the color propertyfont-family: helvetica, arial, sans-serif These are allacceptable values for the font-family propertybackground-image: url("imageFile.jpg") This property looksfor a URL value that points to a specific image fileheight: 40px 50% Height can be set as an explicit width or asa percentage of the containing boxClick on a property to see the acceptable values: http://www.htmldog.com/references/css/properties/
© 2017 Thinkful. All Rights Reserved. 31CSS Exampleh1 {color: red;font-size: 36px;}This is a declaration block, containing twodeclarations:
© 2017 Thinkful. All Rights Reserved. 32CSS Target PracticeClasses drill: Add classes to the two divs to create ablue box and a red box, as described in the codecomments and paragraphs in the codepen. You’ll needto use background-color, margin-bottom, and border.http://codepen.io/team/thinkful/pen/jrWKKOSelector drill: write one ruleset for sections that givesthem a margin-bottom of 90px, and a second ruleset forheader elements that sets font-family to Helveticahttp://codepen.io/team/thinkful/pen/ZOLmyN
© 2017 Thinkful. All Rights Reserved. 33Linking CSS to HTMLWe don’t have to deal with this thanks to CodepenNormally you’d have one HTML file for each webpage(for example, home.html and profile.html), and a singleCSS file for the whole website’s styles (styles.css)To link your stylesheet to your HTML, you’d insert thefollowing line into the <head> section of your HTMLwebpage:<link rel="stylesheet" type="text/css"href="theme.css">
© 2017 Thinkful. All Rights Reserved. 34CSS LayoutCSS layout determines how elements are arranged around each other. Forexample, Facebook wrote styles to make the nav bar stick to the top, have thepages and favorites section on the left and the news feed run in the center:
© 2017 Thinkful. All Rights Reserved. 35CSS LayoutKey concepts:Display: inline vs display: blockThe box modelPosition property
© 2017 Thinkful. All Rights Reserved. 36In-line vs blockEvery element has a display property set to in-line orblock.A block-level element always starts on a new lineand stretches to the full width availableAn inline element does not start on a new line andonly takes up as much width as necessaryEvery element has a default value, and that value canbe over-ridden by setting an explicit value.
© 2017 Thinkful. All Rights Reserved. 37In-line vs blockFor a full list of inline elements, see: https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elementsFor a full list of block-level elements, see: https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements
© 2017 Thinkful. All Rights Reserved. 38The box model & position propertyElements are boxes. We use the position property to organizethese elements/boxes around each other. The position propertyhas four values:Static: normal flow. Block elements stack on top of each other.Inline elements are as large as the content they contain.Fixed: outside of normal flow. Stays in same place no matterwhat.Relative: normal flow. Unlike static, can use left, right, top,bottom properties to move the elements around relative towhere they’d otherwise sit.Absolute: outside of normal flow. Stays in a specific spot on apage.
© 2017 Thinkful. All Rights Reserved. 39Static positioningExample: http://codepen.io/team/thinkful/pen/WxGLrr
© 2017 Thinkful. All Rights Reserved. 40Fixed positioningExample: http://codepen.io/team/thinkful/pen/OXRrbJ
© 2017 Thinkful. All Rights Reserved. 41Relative positioningExample: http://codepen.io/team/thinkful/pen/MejZQEWhat happens if I change relative to static?
© 2017 Thinkful. All Rights Reserved. 42Absolute positioningExample: http://codepen.io/team/thinkful/pen/vKXPrrYou’ll be tempted to use absolutepositioning to jerry-rig a design. Don’t dothis. Only use it when you’re working within asmall div that’s not going to change a lot.
© 2017 Thinkful. All Rights Reserved. 43About you pageUsing what we’ve learned today, let’s set up a simple aboutme page that includes:Headline with your nameSmall paragraph about youImage of yourself, or something that you likeThen, we’ll style it using some of the tools we learned.Some ideas are:Unique font-family, size, colorPositioning of elements, particularly the photo
© 2017 Thinkful. All Rights Reserved. 44About you pagehttp://codepen.io/danfriedman9/pen/pEOWZALet’s walk through the starter code togetherDrill: Add another paragraph about yourselfDrill: Add another section to the website similar to the“About me” section called “About my family” with aparagraph of lorem ipsum below it
© 2017 Thinkful. All Rights Reserved. 45Topics we’re not covering / Where to go from hereMore practice… especially with layoutForms and inputResponsive designDeveloper toolsJavaScript for interactivity
© 2017 Thinkful. All Rights Reserved. 46Take-home challengesExpand on your About Me pageBuild a resume with semantic HTMLFinish the positioning exercise at end of tonight’sslides
© 2017 Thinkful. All Rights Reserved. 47Learn to learnLevelofsupportStructure efficiency
© 2017 Thinkful. All Rights Reserved. 48More about Thinkful325+ mentors with an average of10 years of experience in the field
© 2017 Thinkful. All Rights Reserved. 49Support ‘round the clock
© 2017 Thinkful. All Rights Reserved. 50Our resultsJob Titles after GraduationMonths until Employed
© 2017 Thinkful. All Rights Reserved. 51Try the program for twoweeks, includes six mentorsessions - $50Learn HTML/CSS/JavaScriptOption to continue onto webdevelopment bootcampCome talk to me if you’reinterested (or email me atnoel@thinkful.com)Try us out!
Thank you!Email me with questions or suggestions:noel@thinkful.comApril 2017
© 2017 Thinkful. All Rights Reserved. 53Positioning exerciseNote: we likely will not have time for this tonight.Build this layout:
© 2017 Thinkful. All Rights Reserved. 54Positioning exercise
© 2017 Thinkful. All Rights Reserved. 55Positioning exercise: Reasoning about LayoutImages can be downloaded from here: https://github.com/Thinkful-Ed/css_layout_exercises/tree/solutions/imagesSteps:Break the page down into its componentsPick one to start with (top to bottom, left to right)List the elements inside of a componentIdentify if a given element should be inline or block, and pick themost appropriate HTML elementCode the first element (once again, top to bottom, left to right)Trick: put a 1px red box around every element with “* {border: 1pxsolid red; }”. That will let you visualize the boxes of elements moreeffectively.

Recommended

PDF
Intro to HTML & CSS
PPTX
Html, CSS & Web Designing
PDF
Intro to HTML and CSS basics
PPTX
Html
PPTX
Basic Html Knowledge for students
ODP
CSS Basics
PPTX
Css ppt
PDF
Html / CSS Presentation
ODP
Introduction of Html/css/js
PDF
Introduction to HTML and CSS
PPT
Presentation on html, css
PPTX
HTML, CSS and Java Scripts Basics
PPT
Html basics
PPTX
Introduction to CSS
PPT
Advanced Cascading Style Sheets
PDF
PDF
HTML Head Section Elements
PPTX
HTML (Web) basics for a beginner
PPTX
PPTX
(Fast) Introduction to HTML & CSS
ODP
HTML5
PPTX
PPTX
Cascading style sheet
PPT
PPT
Intro Html
PPT
Html Slide Part-1
PDF
Html forms
PDF
HTML/CSS Crash Course (april 4 2017)
PDF
Web Design & Development - Session 2

More Related Content

PDF
Intro to HTML & CSS
PPTX
Html, CSS & Web Designing
PDF
Intro to HTML and CSS basics
PPTX
Html
PPTX
Basic Html Knowledge for students
ODP
CSS Basics
PPTX
Css ppt
Intro to HTML & CSS
Html, CSS & Web Designing
Intro to HTML and CSS basics
Html
Basic Html Knowledge for students
CSS Basics
Css ppt

What's hot

PDF
Html / CSS Presentation
ODP
Introduction of Html/css/js
PDF
Introduction to HTML and CSS
PPT
Presentation on html, css
PPTX
HTML, CSS and Java Scripts Basics
PPT
Html basics
PPTX
Introduction to CSS
PPT
Advanced Cascading Style Sheets
PDF
PDF
HTML Head Section Elements
PPTX
HTML (Web) basics for a beginner
PPTX
PPTX
(Fast) Introduction to HTML & CSS
ODP
HTML5
PPTX
PPTX
Cascading style sheet
PPT
PPT
Intro Html
PPT
Html Slide Part-1
PDF
Html forms
Html / CSS Presentation
Introduction of Html/css/js
Introduction to HTML and CSS
Presentation on html, css
HTML, CSS and Java Scripts Basics
Html basics
Introduction to CSS
Advanced Cascading Style Sheets
HTML Head Section Elements
HTML (Web) basics for a beginner
(Fast) Introduction to HTML & CSS
HTML5
Cascading style sheet
Intro Html
Html Slide Part-1
Html forms

Similar to Frontend Crash Course: HTML and CSS

PDF
HTML/CSS Crash Course (april 4 2017)
PDF
Web Design & Development - Session 2
PDF
Thinkful - HTML/CSS Crash Course (May 4 2017)
PDF
Code & Design Your First Website (Downtown Los Angeles)
PDF
Thinkful - Frontend Crash Course - Intro to HTML/CSS
PPT
Introduction to Web Technology and Web Page Development
ODP
Light introduction to HTML
PPTX
Workshop 2 Slides.pptx
PDF
Html:css crash course (4:5)
PDF
Html css crash course may 11th, atlanta
PDF
GDI Seattle Intro to HTML and CSS - Class 1
PDF
Code &amp; design your first website (3:16)
PDF
Fccwc326
PDF
Code & Design your first website 4/18
PPTX
Rapid HTML Prototyping with Bootstrap 4
PDF
Design for developers (april 25, 2017)
PDF
Tfbyoweb.4.9.17
PDF
Tfbyoweb.4.9.17
PDF
BYOWHC823
PDF
HTML+CSS: how to get started
HTML/CSS Crash Course (april 4 2017)
Web Design & Development - Session 2
Thinkful - HTML/CSS Crash Course (May 4 2017)
Code & Design Your First Website (Downtown Los Angeles)
Thinkful - Frontend Crash Course - Intro to HTML/CSS
Introduction to Web Technology and Web Page Development
Light introduction to HTML
Workshop 2 Slides.pptx
Html:css crash course (4:5)
Html css crash course may 11th, atlanta
GDI Seattle Intro to HTML and CSS - Class 1
Code &amp; design your first website (3:16)
Fccwc326
Code & Design your first website 4/18
Rapid HTML Prototyping with Bootstrap 4
Design for developers (april 25, 2017)
Tfbyoweb.4.9.17
Tfbyoweb.4.9.17
BYOWHC823
HTML+CSS: how to get started

More from Thinkful

PDF
Byowwhc110
PDF
Websitesd1.15.17.
PDF
1/16/18 Intro to JS Workshop
PDF
(LA 1/16/18) Intro to #"button" role="switch" aria-checked="false" aria-label="Save (LA 1/16/18) Intro to #" aria-haspopup="dialog" aria-controls=":R3d4cpa9r6:" popovertarget=":R3d4cpa9r6:">
PDF
LA 1/16/18 Intro to #"button" role="switch" aria-checked="false" aria-label="Save LA 1/16/18 Intro to #" aria-haspopup="dialog" aria-controls=":R3d5cpa9r6:" popovertarget=":R3d5cpa9r6:">
PDF
Introjs1.9.18tf
PDF
Build your-own-instagram-filters-with-javascript-202-335 (1)
PDF
LA 1/31/18 Intro to #"button" role="switch" aria-checked="false" aria-label="Save LA 1/31/18 Intro to #" aria-haspopup="dialog" aria-controls=":R3d8cpa9r6:" popovertarget=":R3d8cpa9r6:">
PDF
LA 1/31/18 Intro to #"button" role="switch" aria-checked="false" aria-label="Save LA 1/31/18 Intro to #" aria-haspopup="dialog" aria-controls=":R3d9cpa9r6:" popovertarget=":R3d9cpa9r6:">
PDF
Itjsf129
PDF
Baggwjs124
PDF
Vpet sd-1.25.18
PDF
Getting started-jan-9-2018
PDF
893ff61f-1fb8-4e15-a379-775dfdbcee77-7-14-25-46-115-141-308-324-370
PDF
Batbwjs117
PDF
How to Choose a Programming Language
PDF
Bavpwjs110
PDF
Become a Data Scientist: A Thinkful Info Session
PDF
LA 1/18/18 Become A Web Developer: A Thinkful Info Session
PDF
Twit botsd1.30.18
Byowwhc110
Websitesd1.15.17.
1/16/18 Intro to JS Workshop
(LA 1/16/18) Intro to #"button" role="switch" aria-checked="false" aria-label="Save (LA 1/16/18) Intro to #" aria-haspopup="dialog" aria-controls=":R3chkpa9r6:" popovertarget=":R3chkpa9r6:">
LA 1/16/18 Intro to #"button" role="switch" aria-checked="false" aria-label="Save LA 1/16/18 Intro to #" aria-haspopup="dialog" aria-controls=":R3clkpa9r6:" popovertarget=":R3clkpa9r6:">
Introjs1.9.18tf
Build your-own-instagram-filters-with-javascript-202-335 (1)
LA 1/31/18 Intro to #"button" role="switch" aria-checked="false" aria-label="Save LA 1/31/18 Intro to #" aria-haspopup="dialog" aria-controls=":R3d1kpa9r6:" popovertarget=":R3d1kpa9r6:">
LA 1/31/18 Intro to #"button" role="switch" aria-checked="false" aria-label="Save LA 1/31/18 Intro to #" aria-haspopup="dialog" aria-controls=":R3d5kpa9r6:" popovertarget=":R3d5kpa9r6:">
Itjsf129
Baggwjs124
Vpet sd-1.25.18
Getting started-jan-9-2018
893ff61f-1fb8-4e15-a379-775dfdbcee77-7-14-25-46-115-141-308-324-370
Batbwjs117
How to Choose a Programming Language
Bavpwjs110
Become a Data Scientist: A Thinkful Info Session
LA 1/18/18 Become A Web Developer: A Thinkful Info Session
Twit botsd1.30.18

Recently uploaded

PDF
FAMILY ASSESSMENT FORMAT - CHN practical
PPTX
How to Manage Line Discounts in Odoo 18 POS
PPTX
How to Configure Push & Pull Rule in Odoo 18 Inventory
PPTX
Pain. definition, causes, factor influencing pain & pain assessment.pptx
PDF
Scalable-MADDPG-Based Cooperative Target Invasion for a Multi-USV System.pdf
PPTX
AI_in_Daily_Life_Presentation and more.pptx
PPTX
Semester 6 UNIT 2 Dislocation of hip.pptx
PDF
DHA/HAAD/MOH/DOH OPTOMETRY MCQ PYQ. .pdf
PDF
Projecte de la porta de la classe de primer A: Mar i cel.
PPTX
Details of Epithelial and Connective Tissue.pptx
PDF
Toward Massive, Ultrareliable, and Low-Latency Wireless Communication With Sh...
PDF
Unit-III pdf (Basic listening Skill, Effective Writing Communication & Writin...
PDF
All Students Workshop 25 Yoga Wellness by LDMMIA
PPTX
PURPOSIVE SAMPLING IN EDUCATIONAL RESEARCH RACHITHRA RK.pptx
PPTX
2025-2026 History in your Hands Class 4 December 2025 January 2026 .pptx
PPTX
Unit I — Introduction to Anatomical Terms and Organization of the Human Body
PDF
Models of Teaching - TNTEU - B.Ed I Semester - Teaching and Learning - BD1TL ...
PPTX
extracting significant information to formulate sound judgement
PPTX
TAMIS & TEMS - HOW, WHY and THE STEPS IN PROCTOLOGY
PPTX
Cost of Capital - Cost of Equity, Cost of debenture, Cost of Preference share...
FAMILY ASSESSMENT FORMAT - CHN practical
How to Manage Line Discounts in Odoo 18 POS
How to Configure Push & Pull Rule in Odoo 18 Inventory
Pain. definition, causes, factor influencing pain & pain assessment.pptx
Scalable-MADDPG-Based Cooperative Target Invasion for a Multi-USV System.pdf
AI_in_Daily_Life_Presentation and more.pptx
Semester 6 UNIT 2 Dislocation of hip.pptx
DHA/HAAD/MOH/DOH OPTOMETRY MCQ PYQ. .pdf
Projecte de la porta de la classe de primer A: Mar i cel.
Details of Epithelial and Connective Tissue.pptx
Toward Massive, Ultrareliable, and Low-Latency Wireless Communication With Sh...
Unit-III pdf (Basic listening Skill, Effective Writing Communication & Writin...
All Students Workshop 25 Yoga Wellness by LDMMIA
PURPOSIVE SAMPLING IN EDUCATIONAL RESEARCH RACHITHRA RK.pptx
2025-2026 History in your Hands Class 4 December 2025 January 2026 .pptx
Unit I — Introduction to Anatomical Terms and Organization of the Human Body
Models of Teaching - TNTEU - B.Ed I Semester - Teaching and Learning - BD1TL ...
extracting significant information to formulate sound judgement
TAMIS & TEMS - HOW, WHY and THE STEPS IN PROCTOLOGY
Cost of Capital - Cost of Equity, Cost of debenture, Cost of Preference share...

Frontend Crash Course: HTML and CSS

  • 1.
    Frontend Crash Course:HTML& CSSWifi network: CrossCamp.us Eventshttp://bit.ly/html-css-la
  • 2.
    © 2017 Thinkful.All Rights Reserved. 2About usWe train developers and datascientists through 1-on-1mentorship and career prep
  • 3.
    © 2017 Thinkful.All Rights Reserved. 3About meNoel DuarteLos Angeles Area General ManagerUC Berkeley ’15 — worked primarily with R forpopulation genetics analysis, at Thinkful since January2016
  • 4.
    © 2017 Thinkful.All Rights Reserved. 4About youWhy are you here?I’m interested in becoming a developerI’m just curious about what coding isProgramming experience?First lines of code will be written tonightBeen self teaching for 1-3 monthsBeen at this for 3+ months
  • 5.
    © 2017 Thinkful.All Rights Reserved. 5GoalsUnderstand core concepts of using HTML/CSS tobuild websitesComplete drills to put those concepts into practiceBuild your first websiteLearn to learn programming, especially the feeling ofstruggling with a conceptTake home challenges to keep going
  • 6.
    © 2017 Thinkful.All Rights Reserved. 6Not goalsExhaustive coverage of HTML elements / CSSselectorsJavaScript programming for interactivityUsing developer tools
  • 7.
    © 2017 Thinkful.All Rights Reserved. 7Why learn frontend developmentJob opportunitiesEveryone needs a website. You can build themGood starting place to see if coding is for you
  • 8.
    © 2017 Thinkful.All Rights Reserved. 8Client / ServerFront-end developer Back-end developerClient Server
  • 9.
    © 2017 Thinkful.All Rights Reserved. 9How that relates to what we’re doingWhen we write HTML & CSS today, we arecreating those files that are stored on aserver, sent through a series of tubes, andthen rendered by your browser
  • 10.
    © 2017 Thinkful.All Rights Reserved. 10SetupNormally, developers use a text editor to write codeToday, we’re using a tool called CodepenCodepen lets you write HTML/CSS and instantlysee the results of your workCreate an account: https://codepen.io/accounts/signupOn second page, fill out your info you want to saveyour workCreate a new “pen”
  • 11.
    © 2017 Thinkful.All Rights Reserved. 11Your first websiteCopy this (don’t worry if you don’t yet understand):<html><body><h1>Hello world!</h1></body></html>
  • 12.
    © 2017 Thinkful.All Rights Reserved. 12What is HTML?HTML is the content andstructure of a webpage
  • 13.
    © 2017 Thinkful.All Rights Reserved. 13What is HTML?
  • 14.
    © 2017 Thinkful.All Rights Reserved. 14What is HTML?
  • 15.
    © 2017 Thinkful.All Rights Reserved. 15What is HTML?HTML is the content and structure of a webpageThree key concepts:TagsElementsAttributes
  • 16.
    © 2017 Thinkful.All Rights Reserved. 16HTML TagsEvery tag starts with a “less than” sign and ends with a“greater than” sign<html> This is an HTML tag<body> This is a body tag<h1>Hello world!</h1> This line has two H1tags, one opening and one closing</body></html>
  • 17.
    © 2017 Thinkful.All Rights Reserved. 17HTML TagsThere are opening tags and closing tags. Closing tagshave a backslash before the tag name.HTML tags have become more semantic with HTML5(or, the word signals the purpose of the tag). We’llreview some common tags shortly.
  • 18.
    © 2017 Thinkful.All Rights Reserved. 18HTML ElementsHTML elements usually consist of an opening tag, closingtag, and some content.<html><body> This element starts here and ends two lines below<h1>Hello world!</h1> This is an HTML element</body></html>Some consist of just a self-closing tag<img src=“http://i.imgur.com/Th5404r.jpg">
  • 19.
    © 2017 Thinkful.All Rights Reserved. 19HTML ElementsA non-exhaustive list of HTML elements:<html> HTML tags wrap your entire page<head> Head tags<body> Body tags<h1> H1 tags signify the largest headline. H2signifies subhead… through h6<p> Paragraph tags wrap a paragraph of writing
  • 20.
    © 2017 Thinkful.All Rights Reserved. 20HTML Elements<p> Paragraph tags wrap a paragraph of writing<section> Section tags help you organize differentsections of your layout<div> Div tags are generic/non-semantic container tagsfor anything that needs a container<a> Anchor tags are for setting some text to be a link<ul> <li> / <ol><li> Unordered list and ordered lists arefor lists of items, containing list item elements<button> This is a button
  • 21.
    © 2017 Thinkful.All Rights Reserved. 21HTML AttributesHTML attributes set properties on an element. They belongin the opening tag. Here are three common attributes:<a href=“https://somewhere.com">This is a link</a> hrefis an attribute for setting the destination of a link<h1 class=“headline”>This is a headline</h1> class is anattribute that doesn’t show up in the rendered webpage,but will be important when we start talking about CSS<h1 id=“headline”>This is a headline</h1> id is anattribute that doesn’t show up in the rendered webpage,but will be important when we start talking about CSS
  • 22.
    © 2017 Thinkful.All Rights Reserved. 22HTML DrillsLink here, link there:http://codepen.io/team/thinkful/pen/qNOGmPImages 101: http://codepen.io/team/thinkful/pen/gMaJvqCreating headers: http://codepen.io/team/thinkful/pen/JKGPdWAdd a header element inside of the body (but before themain content). Inside the header, add a title ("Lorem Ipsum")on one line, followed by a subtitle on the next ("Holdingplaces since the 1st century BCE"). The subtitle text shouldbe smaller than the title text.Link here, link there solution: http://codepen.io/team/thinkful/pen/aZNGdPImages 101 solution :http://codepen.io/team/thinkful/pen/OXNZXRCreating headers: http://codepen.io/team/thinkful/pen/KMzRzy
  • 23.
    © 2017 Thinkful.All Rights Reserved. 23HTML reviewWhat is HTML?TagsElementsAttributesGoogling HTML elements
  • 24.
    © 2017 Thinkful.All Rights Reserved. 24What is CSS?Cascading Style Sheets determine the visualpresentation of your HTML webpages
  • 25.
    © 2017 Thinkful.All Rights Reserved. 25What is CSS?Key concepts:SelectorsPropertyValueDeclaration / Declaration blockTwo problems we solve with CSS:Presentation of specific elementsLayout
  • 26.
    © 2017 Thinkful.All Rights Reserved. 26CSS Exampleh1 {color: red;font-size: 36px;}
  • 27.
    © 2017 Thinkful.All Rights Reserved. 27CSS SelectorsCSS selectors determine which HTML elements are targetedfor specific styles:p This selects all paragraph tags.header This selects HTML elements with the class“header”#navigation This selects HTML elements with the IDnavigationp.header This selects paragraph tags with the headerclassSelectors can be combined.
  • 28.
    © 2017 Thinkful.All Rights Reserved. 28CSS PropertiesCSS properties determine what about the appearanceyou’re setting:color This determines the font colorfont-family This lets you set the typeface as well asbackup typefacesbackground-image This lets you set abackground image for an elementheight This lets you set the height of an element
  • 29.
    © 2017 Thinkful.All Rights Reserved. 29CSS PropertiesEach property has a default value for a given element.When you write CSS, you over-ride that default valuewith a new value.For a full list, see: http://www.htmldog.com/references/css/properties/
  • 30.
    © 2017 Thinkful.All Rights Reserved. 30CSS ValuesEach property has a set of acceptable values that you can set:color: red, blue, green, #CCCCCC These are all acceptablevalues for the color propertyfont-family: helvetica, arial, sans-serif These are allacceptable values for the font-family propertybackground-image: url("imageFile.jpg") This property looksfor a URL value that points to a specific image fileheight: 40px 50% Height can be set as an explicit width or asa percentage of the containing boxClick on a property to see the acceptable values: http://www.htmldog.com/references/css/properties/
  • 31.
    © 2017 Thinkful.All Rights Reserved. 31CSS Exampleh1 {color: red;font-size: 36px;}This is a declaration block, containing twodeclarations:
  • 32.
    © 2017 Thinkful.All Rights Reserved. 32CSS Target PracticeClasses drill: Add classes to the two divs to create ablue box and a red box, as described in the codecomments and paragraphs in the codepen. You’ll needto use background-color, margin-bottom, and border.http://codepen.io/team/thinkful/pen/jrWKKOSelector drill: write one ruleset for sections that givesthem a margin-bottom of 90px, and a second ruleset forheader elements that sets font-family to Helveticahttp://codepen.io/team/thinkful/pen/ZOLmyN
  • 33.
    © 2017 Thinkful.All Rights Reserved. 33Linking CSS to HTMLWe don’t have to deal with this thanks to CodepenNormally you’d have one HTML file for each webpage(for example, home.html and profile.html), and a singleCSS file for the whole website’s styles (styles.css)To link your stylesheet to your HTML, you’d insert thefollowing line into the <head> section of your HTMLwebpage:<link rel="stylesheet" type="text/css"href="theme.css">
  • 34.
    © 2017 Thinkful.All Rights Reserved. 34CSS LayoutCSS layout determines how elements are arranged around each other. Forexample, Facebook wrote styles to make the nav bar stick to the top, have thepages and favorites section on the left and the news feed run in the center:
  • 35.
    © 2017 Thinkful.All Rights Reserved. 35CSS LayoutKey concepts:Display: inline vs display: blockThe box modelPosition property
  • 36.
    © 2017 Thinkful.All Rights Reserved. 36In-line vs blockEvery element has a display property set to in-line orblock.A block-level element always starts on a new lineand stretches to the full width availableAn inline element does not start on a new line andonly takes up as much width as necessaryEvery element has a default value, and that value canbe over-ridden by setting an explicit value.
  • 37.
    © 2017 Thinkful.All Rights Reserved. 37In-line vs blockFor a full list of inline elements, see: https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elementsFor a full list of block-level elements, see: https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements
  • 38.
    © 2017 Thinkful.All Rights Reserved. 38The box model & position propertyElements are boxes. We use the position property to organizethese elements/boxes around each other. The position propertyhas four values:Static: normal flow. Block elements stack on top of each other.Inline elements are as large as the content they contain.Fixed: outside of normal flow. Stays in same place no matterwhat.Relative: normal flow. Unlike static, can use left, right, top,bottom properties to move the elements around relative towhere they’d otherwise sit.Absolute: outside of normal flow. Stays in a specific spot on apage.
  • 39.
    © 2017 Thinkful.All Rights Reserved. 39Static positioningExample: http://codepen.io/team/thinkful/pen/WxGLrr
  • 40.
    © 2017 Thinkful.All Rights Reserved. 40Fixed positioningExample: http://codepen.io/team/thinkful/pen/OXRrbJ
  • 41.
    © 2017 Thinkful.All Rights Reserved. 41Relative positioningExample: http://codepen.io/team/thinkful/pen/MejZQEWhat happens if I change relative to static?
  • 42.
    © 2017 Thinkful.All Rights Reserved. 42Absolute positioningExample: http://codepen.io/team/thinkful/pen/vKXPrrYou’ll be tempted to use absolutepositioning to jerry-rig a design. Don’t dothis. Only use it when you’re working within asmall div that’s not going to change a lot.
  • 43.
    © 2017 Thinkful.All Rights Reserved. 43About you pageUsing what we’ve learned today, let’s set up a simple aboutme page that includes:Headline with your nameSmall paragraph about youImage of yourself, or something that you likeThen, we’ll style it using some of the tools we learned.Some ideas are:Unique font-family, size, colorPositioning of elements, particularly the photo
  • 44.
    © 2017 Thinkful.All Rights Reserved. 44About you pagehttp://codepen.io/danfriedman9/pen/pEOWZALet’s walk through the starter code togetherDrill: Add another paragraph about yourselfDrill: Add another section to the website similar to the“About me” section called “About my family” with aparagraph of lorem ipsum below it
  • 45.
    © 2017 Thinkful.All Rights Reserved. 45Topics we’re not covering / Where to go from hereMore practice… especially with layoutForms and inputResponsive designDeveloper toolsJavaScript for interactivity
  • 46.
    © 2017 Thinkful.All Rights Reserved. 46Take-home challengesExpand on your About Me pageBuild a resume with semantic HTMLFinish the positioning exercise at end of tonight’sslides
  • 47.
    © 2017 Thinkful.All Rights Reserved. 47Learn to learnLevelofsupportStructure efficiency
  • 48.
    © 2017 Thinkful.All Rights Reserved. 48More about Thinkful325+ mentors with an average of10 years of experience in the field
  • 49.
    © 2017 Thinkful.All Rights Reserved. 49Support ‘round the clock
  • 50.
    © 2017 Thinkful.All Rights Reserved. 50Our resultsJob Titles after GraduationMonths until Employed
  • 51.
    © 2017 Thinkful.All Rights Reserved. 51Try the program for twoweeks, includes six mentorsessions - $50Learn HTML/CSS/JavaScriptOption to continue onto webdevelopment bootcampCome talk to me if you’reinterested (or email me atnoel@thinkful.com)Try us out!
  • 52.
    Thank you!Email mewith questions or suggestions:noel@thinkful.comApril 2017
  • 53.
    © 2017 Thinkful.All Rights Reserved. 53Positioning exerciseNote: we likely will not have time for this tonight.Build this layout:
  • 54.
    © 2017 Thinkful.All Rights Reserved. 54Positioning exercise
  • 55.
    © 2017 Thinkful.All Rights Reserved. 55Positioning exercise: Reasoning about LayoutImages can be downloaded from here: https://github.com/Thinkful-Ed/css_layout_exercises/tree/solutions/imagesSteps:Break the page down into its componentsPick one to start with (top to bottom, left to right)List the elements inside of a componentIdentify if a given element should be inline or block, and pick themost appropriate HTML elementCode the first element (once again, top to bottom, left to right)Trick: put a 1px red box around every element with “* {border: 1pxsolid red; }”. That will let you visualize the boxes of elements moreeffectively.

[8]ページ先頭

©2009-2025 Movatter.jp