SlideShare a Scribd company logo
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.

More Related Content

What's hot

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
Julie 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 2016
Milly Schmidt
 
HTML CSS & Javascript
HTML CSS & JavascriptHTML CSS & Javascript
HTML CSS & Javascript
David Lindkvist
 
CSS For Backend Developers
CSS For Backend DevelopersCSS For Backend Developers
CSS For Backend Developers
10Clouds
 
HTML & CSS 2017
HTML & CSS 2017HTML & CSS 2017
HTML & CSS 2017
Colin Loretz
 
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
Laura Hartwig
 
Intermediate Web Design
Intermediate Web DesignIntermediate Web Design
Intermediate Web Design
mlincol2
 
CSS3 Introduction
CSS3 IntroductionCSS3 Introduction
CSS3 Introduction
Jaeni Sahuri
 
ViA Bootstrap 4
ViA Bootstrap 4ViA Bootstrap 4
ViA Bootstrap 4
imdurgesh
 
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 Combination
Sean Burgess
 
Bootstrap 4 ppt
Bootstrap 4 pptBootstrap 4 ppt
Bootstrap 4 ppt
EPAM Systems
 
Workflow Essentials for Web Development
Workflow Essentials for Web DevelopmentWorkflow Essentials for Web Development
Workflow Essentials for Web Development
Xavier Porter
 
Twitter bootstrap training_session_ppt
Twitter bootstrap training_session_pptTwitter bootstrap training_session_ppt
Twitter bootstrap training_session_ppt
Radheshyam 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 PowerPoint
Sahil 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 Drupal
kdmarks
 
Css for Development
Css for DevelopmentCss for Development
Css for Development
tsengsite
 

What's hot (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
 

Similar to Fewd week2 slides

Pfnp slides
Pfnp slidesPfnp slides
Pfnp slides
William Myers
 
HTML and CSS.pptx
HTML and CSS.pptxHTML and CSS.pptx
HTML and CSS.pptx
TripleRainbow
 
Fewd week7 slides
Fewd week7 slidesFewd week7 slides
Fewd week7 slides
William Myers
 
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
Stephanie Wells
 
SMACSS Workshop
SMACSS WorkshopSMACSS Workshop
SMACSS Workshop
Tim Hettler
 
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
Joseph Ssekono
 
Introduction to BOOTSTRAP
Introduction to BOOTSTRAPIntroduction to BOOTSTRAP
Introduction to BOOTSTRAP
Jeanie Arnoco
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.doc
butest
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.doc
butest
 
Sass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LASass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LA
Jake Johnson
 
BEM It! for Brandwatch
BEM It! for BrandwatchBEM It! for Brandwatch
BEM It! for Brandwatch
Max Shirshin
 
Web technologies part-2
Web technologies part-2Web technologies part-2
Web technologies part-2
Michael Anthony
 
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 Methodology
Zohar Arad
 
Introduction to-concrete-5
Introduction to-concrete-5Introduction to-concrete-5
Introduction to-concrete-5
ketanraval
 
Introduction to-concrete-5
Introduction to-concrete-5Introduction to-concrete-5
Introduction to-concrete-5
Ketan Raval
 
Joomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesJoomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic Templates
Andy Wallace
 
Joomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic TemplatesJoomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic Templates
Chris Davenport
 
Highly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSSHighly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSS
Zoe Gillenwater
 
Joomla Beginner Template Presentation
Joomla Beginner Template PresentationJoomla Beginner Template Presentation
Joomla Beginner Template Presentation
alledia
 

Similar to 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
 

More from William Myers

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

More from 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
 

Recently uploaded

一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
k4ncd0z
 
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
3a0sd7z3
 
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
rtunex8r
 
[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024
hackersuli
 
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
uehowe
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
uehowe
 
Design Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptxDesign Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptx
saathvikreddy2003
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
wolfsoftcompanyco
 
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
3a0sd7z3
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
uehowe
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
Donato Onofri
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
davidjhones387
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
xjq03c34
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
Paul Walk
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
Toptal Tech
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
ysasp1
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
Laura Szabó
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
fovkoyb
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
bseovas
 

Recently uploaded (19)

一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
 
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
 
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
 
[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024
 
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
 
Design Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptxDesign Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptx
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
 
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
 

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.