SlideShare une entreprise Scribd logo
1  sur  39
Télécharger pour lire hors ligne
FEWD - WEEK 2
WILL MYERS
Freelance Front End Developer
SLIDES
http://www.slideshare.net/wilkom/fewd-week2-slides
AGENDA
Review
Box Model
Nested Selectors
HTML Template
Lab Time
How To Start
YOUR WEEKLY FEWD GITHUB
REPOSITORY
Use the '+' button in the top-left of GitHub Desktop
(Create tab)
Create a new repository called 'FEWD_Week2'
Choose the [home]/FEWD folder for the local path
Open this repo folder in your editor
Commit the changes and publish the FEWD_Week2
repository to github.com
YOUR WEEKLY WORKING FILES
FROM ME
To get the week2_working_files you should just be able to
select the ga-fewd-files repository in GitHub Desktop and
press 'Sync'. This should pull in this weeks folder from
github.com.
If you any difficulties you should just re-clone the ga-fewd-
files repository.
REVIEW
Let's have a look at some of your work from the last week!
BOX MODEL
Every element in web design is a box.
The CSS box model is essentially a box that wraps around
every HTML element. It consists of: margins, borders,
padding, and the actual content.
BOX MODEL
MARGINS, PADDING AND BORDERS
margin: sets the outer transparent rectangular border of
an element
border: sets the visible rectangular border style of the
element
padding: sets the inner transparent rectangular border
of an element (is colored by a background-color)
marginarea is transparent, paddingarea inherits
background-color, borderhas its own style and color
properties.
MARGINS AND PADDING
The values for marginand paddingdeclarations can be
set with shorthand:
margin: top right bottom left; (clockwise)
margin: top-and-bottom left-and-right;
Each side can also be set individually with a specific
declaration:
padding-left: 10px;
padding-top: 20px;
etc
BORDERS
Borders have their own style declarations:
border-width(number px)
border-style(string - e.g. solid, dotted, dashed)
border-color(string or hex value)
The common shorthand syntax to set a border is:
width style color
border: 4px solid red;
BORDERS
Border style properties: none(low priority), hidden(high
priority), dotted, dashed, solid, double, groove,
ridge, inset, outset
Don't forget border-radius
border-radius:50%;makes a square into a circle
BOX MODEL
You can see a representation of the box model in Chrome
dev tools (Cmd + Alt + I), in the 'Elements' tab.
BOX MODEL
Width = width + padding-left + padding-right + border-left +
border-right
Height = height + padding-top + padding-bottom + border-
top + border-bottom
Padding, border & margin will be outside of the box
.box {
width: 350px;
border: 10px solid black;
};
RESULT (rendered in the browser)
.box {width: 370px;}
BOX MODEL
It is possible to change what is included in a box model
sizing using the property.box-sizing
You can change the value from the default content-box
to border-box. This will include the paddingand
borderin the calculated width rather than adding it on.
.box {
width: 350px;
border: 10px solid black;
box-sizing: border-box;
}
This will lead to a box rendered in the browser of width:
350px
TAGS & BOXES
Copy the tags_boxes folder in week2_working_files into your
FEWD_Week2 folder and open it in Atom.
CSS POSITIONING
You can also position elements with exact values using the
positionproperty and top, left, bottom, right
properties.
positionhas the following values:
static: default positioning in the document flow
absolute: positioned relative to its first non-static
ancestor element
fixed: positioned relative to the browser window
relative: positioned relative to it's normal default
position
http://codepen.io/wilkom/pen/xwmPeL
NESTED SELECTORS
So far we have looked at element selectors, class selectors
and id selectors. If you want to be more precise in your
selecting then you can use the nested selector.
There is more than one way of selecting nested elements,
you can read more .here
The main nested selector is the descendantselector.
li a {
text-decoration: none;
}
This will only select anchor tags that are descendants of a
list-item tag.
NESTED SELECTORS
Copy the nested_selectors folder in week2_working_files into
your FEWD_Week2 folder and open it in Atom.
NORMALISING AND RESETTING CSS
Every browser has a slightly different default style sheet
which is applied to HTML elements before your own linked
CSS styles are applied.
When you want to make sure that a web page looks exactly
the same across lots of different browsers, there are two
common techniques you can use with css before you apply
your own styles:
Reset the browser CSS by linking reset.css first
Normalise the browser CSS by linking normalize.css first
RESETTING CSS
Resetting CSS will remove all a browser's default styles. You
can then add back in only the styles you want, exactly as you
want them. This technique gives your browser an extra
workload when rendering the page, as it has to remove a lot
of styles, but only older browsers are noticeably affected.
You can mitigate against this by only resetting and then
styling the elements that you will actually use. NB there are
multiple reset.css starting points available on the web.
NORMALIZING CSS
Unlike resetting all styles (or whichever ones you use),
normalize.css works with existing browser styles. It "makes
browsers render all elements more consistently and in line
with modern standards".
Normalize CSS is updated regularly and resolves specific
issues with HTML5 elements and mobile browsers as well as
desktop browsers.
NORMALISING AND RESETTING CSS
Some CSS reset links:
(with other tools)
Eric Meyer's CSS Reset
HTML5-Reset
Yahoo UI Reset
Some CSS normalize links:
(with other tools)
Nicolas Gallagher's normalize.css
HTML5 Boilerplate
NORMALISING AND RESETTING CSS
Which to choose?
You should either normalise or reset on a case by case basis.
Or you can just do some simple normalizing/resetting in
your own stylesheet:
* {
margin: 0;
padding: 0;
}
MODERNIZR
Modernizr is a tool that detects the capabilities of the end-
user's browser and then dynamically sets classes on the
<html>root-level element to indicate whether some
browser feature is available or not.
You can then use nested selectors in your CSS to handle
whether a feature is available or not. This technique is
known as progressive enhancement.
https://modernizr.com/docs/#what-is-modernizr
RELAXR LANDING PAGE
Let's have a preliminary look at today's assignment and
think about how to start this project. Specifically we should
look at the design and style guide, as well as the README.
Copy the assignment folder in week2_working_files into your
FEWD_Week2 folder, commit these changes and then
publish to github.com.
RELAXR LANDING PAGE
You can now read the README rendered in the root of the
assigment folder on github.com.
You can also click into the starter_code folder and click on
the design_guide.md.
You can see the design "flat" (image) at
starter_code/images/relaxr_landing.jpg.
You will want to use a . Copy the
background_image_examples folder in week2_working_files
into your FEWD_Week2 folder and open it.
background image
DRAW ME A DOM
Let's draw a DOM tree on the whiteboard for how we think
we should structure the Relaxr landing page.
FEWD - LAYOUT
AGENDA
Review
Divs, Classes and IDs
HTML5 Structural Elements
Floats
Lab Time
REVIEW
What would you like to review?
DIV REVIEW
A generic container, <div>s are often nested in other
<div>s
<div class="parent">
<div class="child">Some child content</div>
</div>
Have a look at this example:
http://codepen.io/wilkom/pen/OyrPzV
CLASS & ID REVIEW
With classes and ids we can target specific elements on a
page, so we can manipulate it uniquely.
CLASS & ID
Copy the error_message folder in week2_working_files into
your FEWD_Week2 folder and open it in Atom.
CLASS & ID
IDs are unique
Classes are not unique
How to select classes in CSS
.className
#idName
HTML5 SIMPLE LAYOUT
<body>
<header>...</header>
<nav>...</nav>
<article>
<section>
...
</section>
</article>
<aside>...</aside>
<footer>...</footer>
</body>
HTML5 STRUCTURAL ELEMENTS REVIEW
Adding structure to HTML elements that are related to
content layout.
header
aside
section
footer
Copy the simple_page_layouts folder in week2_working_files
into your FEWD_Week2 folder and open it in Atom.
Use HTML5 structural elements instead of <divs>
FLOATS
Float is originally intended for making content 'float
alongside' other content. It ended up also being used to
float containers alongside each other.
Floated layouts are now being replaced by flexbox, which
we will look at next week.
FLOATS
You can 'float' elements to the left or right of a parent
container.
Floats are still often used for page layouts - for example to
have a sidebar
You need to use the clearproperty in the style applied
to the container of the floated elements. This stops the
container collapsing, and the float affecting the rest of the
page. By convention a style for clearing a float is
commonly called a clearfix. You can also put a
clearfixright after a floated element, on the same
hierarchical level.
LAYOUT CHALLENGE
Copy the layout_challenge folder in week2_working_files
into your FEWD_Week2 folder and open it in Atom.

Contenu connexe

Tendances

Decoupling the Front-end with Modular CSS
Decoupling the Front-end with Modular CSSDecoupling the Front-end with Modular CSS
Decoupling the Front-end with Modular CSSJulie Cameron
 
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...Jer Clarke
 
HTML/CSS Crash Course (april 4 2017)
HTML/CSS Crash Course (april 4 2017)HTML/CSS Crash Course (april 4 2017)
HTML/CSS Crash Course (april 4 2017)Daniel Friedman
 
Coding for beginners - Future Assembly 2016
Coding for beginners - Future Assembly 2016Coding for beginners - Future Assembly 2016
Coding for beginners - Future Assembly 2016Milly Schmidt
 
CSS For Backend Developers
CSS For Backend DevelopersCSS For Backend Developers
CSS For Backend Developers10Clouds
 
Customizing Your WordPress Theme Using Firebug and Basic CSS
Customizing Your WordPress Theme Using Firebug and Basic CSSCustomizing Your WordPress Theme Using Firebug and Basic CSS
Customizing Your WordPress Theme Using Firebug and Basic CSSLaura Hartwig
 
Intermediate Web Design
Intermediate Web DesignIntermediate Web Design
Intermediate Web Designmlincol2
 
ViA Bootstrap 4
ViA Bootstrap 4ViA Bootstrap 4
ViA Bootstrap 4imdurgesh
 
HTML and CSS crash course!
HTML and CSS crash course!HTML and CSS crash course!
HTML and CSS crash course!Ana Cidre
 
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationLotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationSean Burgess
 
Workflow Essentials for Web Development
Workflow Essentials for Web DevelopmentWorkflow Essentials for Web Development
Workflow Essentials for Web DevelopmentXavier Porter
 
Twitter bootstrap training_session_ppt
Twitter bootstrap training_session_pptTwitter bootstrap training_session_ppt
Twitter bootstrap training_session_pptRadheshyam Kori
 
Basics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPointBasics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPointSahil Gandhi
 
What is Object Oriented CSS?
What is Object Oriented CSS?What is Object Oriented CSS?
What is Object Oriented CSS?Nicole Sullivan
 
Workshop I: Intro to Using Drupal
Workshop I: Intro to Using DrupalWorkshop I: Intro to Using Drupal
Workshop I: Intro to Using Drupalkdmarks
 
Css for Development
Css for DevelopmentCss for Development
Css for Developmenttsengsite
 

Tendances (20)

Decoupling the Front-end with Modular CSS
Decoupling the Front-end with Modular CSSDecoupling the Front-end with Modular CSS
Decoupling the Front-end with Modular CSS
 
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
 
HTML/CSS Crash Course (april 4 2017)
HTML/CSS Crash Course (april 4 2017)HTML/CSS Crash Course (april 4 2017)
HTML/CSS Crash Course (april 4 2017)
 
Coding for beginners - Future Assembly 2016
Coding for beginners - Future Assembly 2016Coding for beginners - Future Assembly 2016
Coding for beginners - Future Assembly 2016
 
HTML CSS & Javascript
HTML CSS & JavascriptHTML CSS & Javascript
HTML CSS & Javascript
 
CSS For Backend Developers
CSS For Backend DevelopersCSS For Backend Developers
CSS For Backend Developers
 
HTML & CSS 2017
HTML & CSS 2017HTML & CSS 2017
HTML & CSS 2017
 
Customizing Your WordPress Theme Using Firebug and Basic CSS
Customizing Your WordPress Theme Using Firebug and Basic CSSCustomizing Your WordPress Theme Using Firebug and Basic CSS
Customizing Your WordPress Theme Using Firebug and Basic CSS
 
Intermediate Web Design
Intermediate Web DesignIntermediate Web Design
Intermediate Web Design
 
CSS3 Introduction
CSS3 IntroductionCSS3 Introduction
CSS3 Introduction
 
ViA Bootstrap 4
ViA Bootstrap 4ViA Bootstrap 4
ViA Bootstrap 4
 
HTML and CSS crash course!
HTML and CSS crash course!HTML and CSS crash course!
HTML and CSS crash course!
 
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationLotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
 
Bootstrap 4 ppt
Bootstrap 4 pptBootstrap 4 ppt
Bootstrap 4 ppt
 
Workflow Essentials for Web Development
Workflow Essentials for Web DevelopmentWorkflow Essentials for Web Development
Workflow Essentials for Web Development
 
Twitter bootstrap training_session_ppt
Twitter bootstrap training_session_pptTwitter bootstrap training_session_ppt
Twitter bootstrap training_session_ppt
 
Basics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPointBasics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPoint
 
What is Object Oriented CSS?
What is Object Oriented CSS?What is Object Oriented CSS?
What is Object Oriented CSS?
 
Workshop I: Intro to Using Drupal
Workshop I: Intro to Using DrupalWorkshop I: Intro to Using Drupal
Workshop I: Intro to Using Drupal
 
Css for Development
Css for DevelopmentCss for Development
Css for Development
 

Similaire à Fewd week2 slides

Writing your own WordPress themes and plugins
Writing your own WordPress themes and pluginsWriting your own WordPress themes and plugins
Writing your own WordPress themes and pluginsStephanie Wells
 
X tag with web components - joe ssekono
X tag with web components - joe ssekonoX tag with web components - joe ssekono
X tag with web components - joe ssekonoJoseph Ssekono
 
Introduction to BOOTSTRAP
Introduction to BOOTSTRAPIntroduction to BOOTSTRAP
Introduction to BOOTSTRAPJeanie Arnoco
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.docbutest
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.docbutest
 
Sass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LASass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LAJake Johnson
 
BEM It! for Brandwatch
BEM It! for BrandwatchBEM It! for Brandwatch
BEM It! for BrandwatchMax Shirshin
 
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...Modern Theming & The Future of WordPress- Working with Full Site Editing and ...
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...WP Engine
 
CSS Methodology
CSS MethodologyCSS Methodology
CSS MethodologyZohar Arad
 
Introduction to-concrete-5
Introduction to-concrete-5Introduction to-concrete-5
Introduction to-concrete-5Ketan Raval
 
Introduction to-concrete-5
Introduction to-concrete-5Introduction to-concrete-5
Introduction to-concrete-5ketanraval
 
Joomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesJoomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesAndy Wallace
 
Joomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic TemplatesJoomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic TemplatesChris Davenport
 
Highly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSSHighly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSSZoe Gillenwater
 
Joomla Beginner Template Presentation
Joomla Beginner Template PresentationJoomla Beginner Template Presentation
Joomla Beginner Template Presentationalledia
 

Similaire à Fewd week2 slides (20)

Pfnp slides
Pfnp slidesPfnp slides
Pfnp slides
 
HTML and CSS.pptx
HTML and CSS.pptxHTML and CSS.pptx
HTML and CSS.pptx
 
Fewd week7 slides
Fewd week7 slidesFewd week7 slides
Fewd week7 slides
 
Writing your own WordPress themes and plugins
Writing your own WordPress themes and pluginsWriting your own WordPress themes and plugins
Writing your own WordPress themes and plugins
 
SMACSS Workshop
SMACSS WorkshopSMACSS Workshop
SMACSS Workshop
 
X tag with web components - joe ssekono
X tag with web components - joe ssekonoX tag with web components - joe ssekono
X tag with web components - joe ssekono
 
Introduction to BOOTSTRAP
Introduction to BOOTSTRAPIntroduction to BOOTSTRAP
Introduction to BOOTSTRAP
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.doc
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.doc
 
Sass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LASass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LA
 
BEM It! for Brandwatch
BEM It! for BrandwatchBEM It! for Brandwatch
BEM It! for Brandwatch
 
Web technologies part-2
Web technologies part-2Web technologies part-2
Web technologies part-2
 
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...Modern Theming & The Future of WordPress- Working with Full Site Editing and ...
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...
 
CSS Methodology
CSS MethodologyCSS Methodology
CSS Methodology
 
Introduction to-concrete-5
Introduction to-concrete-5Introduction to-concrete-5
Introduction to-concrete-5
 
Introduction to-concrete-5
Introduction to-concrete-5Introduction to-concrete-5
Introduction to-concrete-5
 
Joomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesJoomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic Templates
 
Joomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic TemplatesJoomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic Templates
 
Highly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSSHighly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSS
 
Joomla Beginner Template Presentation
Joomla Beginner Template PresentationJoomla Beginner Template Presentation
Joomla Beginner Template Presentation
 

Plus de William Myers

Plus de William Myers (6)

Fewd week8 slides
Fewd week8 slidesFewd week8 slides
Fewd week8 slides
 
Fewd week6 slides
Fewd week6 slidesFewd week6 slides
Fewd week6 slides
 
Fewd week5 slides
Fewd week5 slidesFewd week5 slides
Fewd week5 slides
 
Fewd week4 slides
Fewd week4 slidesFewd week4 slides
Fewd week4 slides
 
Fewd week3 slides
Fewd week3 slidesFewd week3 slides
Fewd week3 slides
 
Fewd week1 slides
Fewd week1 slidesFewd week1 slides
Fewd week1 slides
 

Dernier

办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一z xss
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书rnrncn29
 
Unidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxUnidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxmibuzondetrabajo
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxDyna Gilbert
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predieusebiomeyer
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书rnrncn29
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationLinaWolf1
 
Q4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptxQ4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptxeditsforyah
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa494f574xmv
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Sonam Pathan
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhimiss dipika
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Paul Calvano
 
NSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentationNSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentationMarko4394
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书zdzoqco
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作ys8omjxb
 
Internet of Things Presentation (IoT).pptx
Internet of Things Presentation (IoT).pptxInternet of Things Presentation (IoT).pptx
Internet of Things Presentation (IoT).pptxErYashwantJagtap
 

Dernier (17)

办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
 
Unidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxUnidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptx
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptx
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predi
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 Documentation
 
Q4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptxQ4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptx
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhi
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24
 
NSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentationNSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentation
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
 
Internet of Things Presentation (IoT).pptx
Internet of Things Presentation (IoT).pptxInternet of Things Presentation (IoT).pptx
Internet of Things Presentation (IoT).pptx
 
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
 

Fewd week2 slides

  • 1. FEWD - WEEK 2 WILL MYERS Freelance Front End Developer SLIDES http://www.slideshare.net/wilkom/fewd-week2-slides
  • 2. AGENDA Review Box Model Nested Selectors HTML Template Lab Time How To Start
  • 3. YOUR WEEKLY FEWD GITHUB REPOSITORY Use the '+' button in the top-left of GitHub Desktop (Create tab) Create a new repository called 'FEWD_Week2' Choose the [home]/FEWD folder for the local path Open this repo folder in your editor Commit the changes and publish the FEWD_Week2 repository to github.com
  • 4. YOUR WEEKLY WORKING FILES FROM ME To get the week2_working_files you should just be able to select the ga-fewd-files repository in GitHub Desktop and press 'Sync'. This should pull in this weeks folder from github.com. If you any difficulties you should just re-clone the ga-fewd- files repository.
  • 5. REVIEW Let's have a look at some of your work from the last week!
  • 6. BOX MODEL Every element in web design is a box. The CSS box model is essentially a box that wraps around every HTML element. It consists of: margins, borders, padding, and the actual content.
  • 8. MARGINS, PADDING AND BORDERS margin: sets the outer transparent rectangular border of an element border: sets the visible rectangular border style of the element padding: sets the inner transparent rectangular border of an element (is colored by a background-color) marginarea is transparent, paddingarea inherits background-color, borderhas its own style and color properties.
  • 9. MARGINS AND PADDING The values for marginand paddingdeclarations can be set with shorthand: margin: top right bottom left; (clockwise) margin: top-and-bottom left-and-right; Each side can also be set individually with a specific declaration: padding-left: 10px; padding-top: 20px; etc
  • 10. BORDERS Borders have their own style declarations: border-width(number px) border-style(string - e.g. solid, dotted, dashed) border-color(string or hex value) The common shorthand syntax to set a border is: width style color border: 4px solid red;
  • 11. BORDERS Border style properties: none(low priority), hidden(high priority), dotted, dashed, solid, double, groove, ridge, inset, outset Don't forget border-radius border-radius:50%;makes a square into a circle
  • 12. BOX MODEL You can see a representation of the box model in Chrome dev tools (Cmd + Alt + I), in the 'Elements' tab.
  • 13. BOX MODEL Width = width + padding-left + padding-right + border-left + border-right Height = height + padding-top + padding-bottom + border- top + border-bottom Padding, border & margin will be outside of the box .box { width: 350px; border: 10px solid black; }; RESULT (rendered in the browser) .box {width: 370px;}
  • 14. BOX MODEL It is possible to change what is included in a box model sizing using the property.box-sizing You can change the value from the default content-box to border-box. This will include the paddingand borderin the calculated width rather than adding it on. .box { width: 350px; border: 10px solid black; box-sizing: border-box; } This will lead to a box rendered in the browser of width: 350px
  • 15. TAGS & BOXES Copy the tags_boxes folder in week2_working_files into your FEWD_Week2 folder and open it in Atom.
  • 16. CSS POSITIONING You can also position elements with exact values using the positionproperty and top, left, bottom, right properties. positionhas the following values: static: default positioning in the document flow absolute: positioned relative to its first non-static ancestor element fixed: positioned relative to the browser window relative: positioned relative to it's normal default position http://codepen.io/wilkom/pen/xwmPeL
  • 17. NESTED SELECTORS So far we have looked at element selectors, class selectors and id selectors. If you want to be more precise in your selecting then you can use the nested selector. There is more than one way of selecting nested elements, you can read more .here The main nested selector is the descendantselector. li a { text-decoration: none; } This will only select anchor tags that are descendants of a list-item tag.
  • 18. NESTED SELECTORS Copy the nested_selectors folder in week2_working_files into your FEWD_Week2 folder and open it in Atom.
  • 19. NORMALISING AND RESETTING CSS Every browser has a slightly different default style sheet which is applied to HTML elements before your own linked CSS styles are applied. When you want to make sure that a web page looks exactly the same across lots of different browsers, there are two common techniques you can use with css before you apply your own styles: Reset the browser CSS by linking reset.css first Normalise the browser CSS by linking normalize.css first
  • 20. RESETTING CSS Resetting CSS will remove all a browser's default styles. You can then add back in only the styles you want, exactly as you want them. This technique gives your browser an extra workload when rendering the page, as it has to remove a lot of styles, but only older browsers are noticeably affected. You can mitigate against this by only resetting and then styling the elements that you will actually use. NB there are multiple reset.css starting points available on the web.
  • 21. NORMALIZING CSS Unlike resetting all styles (or whichever ones you use), normalize.css works with existing browser styles. It "makes browsers render all elements more consistently and in line with modern standards". Normalize CSS is updated regularly and resolves specific issues with HTML5 elements and mobile browsers as well as desktop browsers.
  • 22. NORMALISING AND RESETTING CSS Some CSS reset links: (with other tools) Eric Meyer's CSS Reset HTML5-Reset Yahoo UI Reset Some CSS normalize links: (with other tools) Nicolas Gallagher's normalize.css HTML5 Boilerplate
  • 23. NORMALISING AND RESETTING CSS Which to choose? You should either normalise or reset on a case by case basis. Or you can just do some simple normalizing/resetting in your own stylesheet: * { margin: 0; padding: 0; }
  • 24. MODERNIZR Modernizr is a tool that detects the capabilities of the end- user's browser and then dynamically sets classes on the <html>root-level element to indicate whether some browser feature is available or not. You can then use nested selectors in your CSS to handle whether a feature is available or not. This technique is known as progressive enhancement. https://modernizr.com/docs/#what-is-modernizr
  • 25. RELAXR LANDING PAGE Let's have a preliminary look at today's assignment and think about how to start this project. Specifically we should look at the design and style guide, as well as the README. Copy the assignment folder in week2_working_files into your FEWD_Week2 folder, commit these changes and then publish to github.com.
  • 26. RELAXR LANDING PAGE You can now read the README rendered in the root of the assigment folder on github.com. You can also click into the starter_code folder and click on the design_guide.md. You can see the design "flat" (image) at starter_code/images/relaxr_landing.jpg. You will want to use a . Copy the background_image_examples folder in week2_working_files into your FEWD_Week2 folder and open it. background image
  • 27. DRAW ME A DOM Let's draw a DOM tree on the whiteboard for how we think we should structure the Relaxr landing page.
  • 29. AGENDA Review Divs, Classes and IDs HTML5 Structural Elements Floats Lab Time
  • 30. REVIEW What would you like to review?
  • 31. DIV REVIEW A generic container, <div>s are often nested in other <div>s <div class="parent"> <div class="child">Some child content</div> </div> Have a look at this example: http://codepen.io/wilkom/pen/OyrPzV
  • 32. CLASS & ID REVIEW With classes and ids we can target specific elements on a page, so we can manipulate it uniquely.
  • 33. CLASS & ID Copy the error_message folder in week2_working_files into your FEWD_Week2 folder and open it in Atom.
  • 34. CLASS & ID IDs are unique Classes are not unique How to select classes in CSS .className #idName
  • 36. HTML5 STRUCTURAL ELEMENTS REVIEW Adding structure to HTML elements that are related to content layout. header aside section footer Copy the simple_page_layouts folder in week2_working_files into your FEWD_Week2 folder and open it in Atom. Use HTML5 structural elements instead of <divs>
  • 37. FLOATS Float is originally intended for making content 'float alongside' other content. It ended up also being used to float containers alongside each other. Floated layouts are now being replaced by flexbox, which we will look at next week.
  • 38. FLOATS You can 'float' elements to the left or right of a parent container. Floats are still often used for page layouts - for example to have a sidebar You need to use the clearproperty in the style applied to the container of the floated elements. This stops the container collapsing, and the float affecting the rest of the page. By convention a style for clearing a float is commonly called a clearfix. You can also put a clearfixright after a floated element, on the same hierarchical level.
  • 39. LAYOUT CHALLENGE Copy the layout_challenge folder in week2_working_files into your FEWD_Week2 folder and open it in Atom.