SlideShare a Scribd company logo
An intro to
HTML, CSS,
& SASS
Sean Wolfe
sean@zivtech.com
β€’ Creative Director at
Zivtech in Philadelphia
β€’ Designing and
theming Drupal sites
since 2008
β€’ UPenn, Carilion Clinic,
Temple University
β€’ A Text editor
β€’ A local webserver (http://www.mamp.info/en)
β€’ Github account (https://github.com)
β€’ SASS (http://sass-lang.com/install)
β€’ Compass (http://compass-style.org/install)
β€’ Bundler (http://bundler.io)
β€’ Livereload (http://livereload.com/)*
!
*optional but highly recommended
Tools
β€’ HTML stands for Hyper Text Markup Language
β€’ HTML is a markup language
β€’ HTML documents contain HTML tags and plain text
β€’ HTML documents are also called web pages
What is HTML?
β€’ HTML tags are keywords (tag names) surrounded by
angle brackets like <html>
β€’ HTML tags normally come in pairs like <p> and </p>
β€’ The first tag in a pair is the start tag, the second tag
is the end tag
β€’ The end tag is written like the start tag, with a slash
before the tag name
β€’ Start and end tags are also called opening tags and
closing tags
HTML Tags
β€’ HTML5 is the latest standard for HTML.
β€’ <canvas> is an element for 2D drawing
β€’ <video> and <audio> are elements for media
playback
β€’ HTML5 uses new content-specific elements, like
<article>, <footer>, <header>, <nav>, <section
HTML5
Intro to html, css & sass
Intro to html, css & sass
Intro to html, css & sass
β€’ The DOCTYPE declaration defines the document type
β€’ The text between <html> and </html> describes the web page
β€’ The <head> element is a container for all the head elements.
β€’ The text between <body> and </body> is the visible page content
β€’ The text between <h1> and </h1> is displayed as a heading
β€’ The text between <p> and </p> is displayed as a paragraph
Basic HTML
β€’ The <title> tag defines the title of the document.
β€’ The <link> tag defines the relationship between a document and an
external resource.
β€’ The <style> tag is used to define style information for an HTML
document.
β€’ The <meta> tag provides metadata about the HTML document.
β€’ The <script> tag is used to define a client-side script, such as a
JavaScript.
HTML Head
β€’ The DOCTYPE declaration defines the document type
β€’ The text between <html> and </html> describes the web page
β€’ The text between <body> and </body> is the visible page content
β€’ The text between <h1> and </h1> is displayed as a heading
β€’ The text between <p> and </p> is displayed as a paragraph
Basic HTML
HTML Headings
β€’ HTML headings are defined with the <h1> to <h6> tags.
HTML Headings
β€’ HTML headings are defined with the <h1> to <h6> tags.
HTML Paragraphs
β€’ HTML paragraphs are defined with the <p> tag.
HTML Paragraphs
β€’ HTML paragraphs are defined with the <p> tag.
HTML Links
β€’ HTML links are defined with the <a> tag.
HTML Links
β€’ HTML links are defined with the <a> tag.
HTML Images
β€’ HTML images are defined with the <img> tag.
HTML Images
β€’ HTML images are defined with the <img> tag.
HTML Lists
β€’ In HTML, there are several types of lists:
β€’ unordered lists - the list items are marked with
bullets
β€’ ordered lists - the list items are marked with
numbers or letters
β€’ description list - a list of terms/names, with a
description of each term/name.
HTML Lists
β€’ CSS stands for Cascading Style Sheets
β€’ Styles define how to display HTML elements
β€’ CSS can solve many design problems without
adding images or changing the HTML
What is CSS?
Intro to html, css & sass
CSS Syntax
html
Selector
ValueValue PropertyProperty
{margin:0; padding:0}
Declaration Declaration
CSS Selectors
β€’ CSS selectors allow you to select and manipulate
HTML element(s).
β€’ CSS selectors are used to "find" (or select) HTML
elements based on their id, classes, types,
attributes, and more.
Types of CSS Selectors
β€’ The element Selector selects elements based on the
element name. (e.g. body, header, p, footer)
β€’ The id Selector selects a specific element on the page and
can only be used once (e.g. #main, #content, #footer)
β€’ The class Selector selects elements with the specific class
names and cans be reused
(e.g. .wrapper, .column, .panel, .panel-pane)
ID’s
classes
elements
Ways to use CSS
β€’ CSS can be attached to HTML in 3 ways
β€’ Inline (wysiwyg for example)
β€’ Embedded (placed in document <head>)
β€’ Links to CSS files (the preferred method)
Ways to use CSS
<p style=β€œcolor:red;”>Some Text</p>
Inline Styles
Ways to use CSS
<head>!
<style>p {color:red;}</style>!
</head>
Embedded Styles
Ways to use CSS
<head>!
<link rel="stylesheet"

type="text/css" href=β€œstyle.css">!
</head>
External Style Sheet reference
p {color:red;}
style.css
CSS Margin
β€’ Margin is the space around elements (outside the
border).
β€’ The margin does not have a background color,
and is completely transparent.
β€’ The top, right, bottom, and left margin can be
changed independently using separate properties.
25px
50px
75px
100px
CSS Margin
{margin:25px 50px 75px 100px;}
CSS Padding
β€’ Padding is the space between the element
border and the element content
β€’ The top, right, bottom, and left padding can be
changed independently using separate
properties.
{padding:25px 50px 75px 100px;}
CSS Padding
25px
50px
75px
100px
{margin:25px 50px 75px 100px;}
CSS Padding & Margin
{padding:25px 50px 75px 100px;}
CSS Text
β€’ color sets the color of text
β€’ letter-spacing adjusts the space between characters
β€’ line-height sets the distance between lines of text
β€’ text-decoration specifies the decoration
β€’ text-indent specifies the indentation of the first line
β€’ text-shadow specifies the shadow effect
β€’ text-transform controls the capitalization of text
β€’ word-spacing changes the space between words
CSS Fonts
β€’ CSS font properties define the font family, boldness, size,
and the style of a text.
β€’ Not all computers have the same fonts installed
β€’ font-family Specifies the font family for text
β€’ font-size Specifies the font size of text
β€’ font-style Specifies the font style for text (e.g. normal or
italic)
β€’ font-variant Specifies if text should be small-caps
β€’ font-weight Specifies the weight of a font
β€’ font Sets all the font properties in one declaration
CSS Fonts
Serif Times New Roman, Georgia
Sans-serif Arial, Verdana
Monospace Courier New, Lucida Console
Web Fonts
Web Fonts
Web Fonts
CSS Pseudo-classes
β€’ CSS pseudo-classes are used to select the current condition of
an element.
β€’ The most common pseudo-classes are links
β€’ Links can be styled differently depending on what state they
are in.
β€’ a:link Selects an unvisited link
β€’ a:visited Selects visited links
β€’ a:active Selects the active link
β€’ a:hover Selects links on mouse over
β€’ p::first-letter Selects the first letter of a paragraph
β€’ p::first-line Selects the first line of a paragraph
CSS Background
β€’ CSS background properties are used to define the background
effects of an element.
β€’ background-color sets the background color of an element
β€’ background-image sets the background image for an element
β€’ background-repeat sets how a background image will be
repeated
β€’ background-attachment sets whether a background image is
fixed or scrolls with the rest of the page
β€’ background-position sets the starting position of a background
image
β€’ background sets all the background properties in one declaration
CSS Positioning
β€’ The CSS positioning properties allow you to position an
element.
β€’ Elements can be positioned using the top, bottom, left, and
right properties.
β€’ position:static is the default position of an element
β€’ position:fixed tells an element to be positioned relative to the
browser window. It will not move even if the window is scrolled
β€’ position:relative tells an element to be positioned relative to
its normal position.
β€’ position:absolute tells an element where to be positioned
relative to its parent element.
{position:relative;}
{position:absolute;}
{position:static;}
{position:static;}
{position:fixed;}
{position:static;}
CSS Float
β€’ With CSS float, an element can be pushed to the
left or right, allowing other elements to wrap
around it.
β€’ clear Specifies which sides of an element where
other floating elements are not allowed.
β€’ float Specifies whether or not a box should float
to the left or right.
img {float:none;}
β€’ Vivamus dignissim nunc eleifend, commodo mi sed,
aliquam ante. Donec id lacus eu lectus sollicitudin viverra.
Curabitur congue ultricies elit, at euismod mauris iaculis
at. Sed et dignissim ipsum. Quisque massa quam, lacinia
vel urna ac, dictum lobortis justo.β€œDonec et molestie
β€’ purus”. Cras et faucibus est, a viverra odio. Praesent luctus vel
purus non mollis. In luctus vitae lectus quis fringilla. Curabitur
porttitor justo ac dolor iaculis convallis.
β€’ Vivamus dignissim nunc eleifend, commodo mi sed,
aliquam ante. Donec id lacus eu lectus sollicitudin viverra.
Curabitur congue ultricies elit, at euismod mauris iaculis
at. Sed et dignissim ipsum. Quisque massa quam, lacinia
vel urna ac, dictum lobortis justo.β€œDonec et molestie
β€’ purus”. Cras et faucibus est, a viverra odio. Praesent luctus vel
purus non mollis. In luctus vitae lectus quis fringilla. Curabitur
porttitor justo ac dolor iaculis convallis.
img {float:left;}
img {float:right;}
β€’ Vivamus dignissim nunc eleifend, commodo mi sed,
aliquam ante. Donec id lacus eu lectus sollicitudin viverra.
Curabitur congue ultricies elit, at euismod mauris iaculis
at. Sed et dignissim ipsum. Quisque massa quam, lacinia
vel urna ac, dictum lobortis justo.β€œDonec et molestie
CSS Float
CSS Display and Visibility
β€’ The display property specifies if/how an element is displayed,
and the visibility property specifies if an element should be
visible or hidden.
β€’ visibility:hidden hides an element, but it will still take up
the same space as before.
β€’ display:none hides an element, and it will not take up any
space.
β€’ display:inline tells an element to only take up as much
width as necessary, and will not force line breaks.
β€’ display:block tells an element will takes up the full width
available, and will have a line break before and after it
CSS Image Opacity / Transparency
β€’ The CSS3 property for transparency is opacity.
β€’ The opacity property can take a value from 0.0 -
1.0. A lower value makes the element more
transparent.
{opacity:0.1;} {opacity:0.5;} {opacity:1.0;}
CSS Image Sprites
β€’ An image sprite is a collection of images put into
a single image.
β€’ A web page with many images can take a long
time to load and generates multiple server
requests.
CSS Media Types
β€’ By using the @media rule, a website can have a
different layout for screen, print, mobile phone,
tablet, etc.
β€’ all Used for all media type devices
β€’ braille Used for braille tactile feedback devices
β€’ print Used for printers
β€’ screen Used for computer screens
β€’ tv Used for television-type devices
CSS3
β€’ CSS3 is the latest standard for CSS and is completely
backwards-compatible with earlier versions of CSS.
β€’ Selectors!
β€’ Box Model!
β€’ Borders!
β€’ Text Effects!
β€’ 2D/3D Transformations!
β€’ Animations!
β€’ Multiple Column Layout
CSS Preprocessors
β€’ SASS stands for Syntactically Awesome Style Sheets
β€’ Sass is a CSS preprocessor
β€’ Sass can be written in either the sass or scss syntax
β€’ Sass files compile into css files
What is SASS?
β€’ CSS doesn’t allow variables
β€’ SASS uses mixins (reusable blocks of styles)
β€’ SASS is faster, more efficient, and easier to maintain
β€’ Using COMPASS with SASS allows us to write many lines
of cross-browser compatible CSS in a single line of code!
Why do we use SASS?
Install Sass
$ gem install sass
nav {!
ul {!
margin: 0;!
}!
li {!
display: block;!
}!
a {!
padding: 6px 12px;!
color: $yellow;!
}!
}
SCSS
nav!
ul!
margin: 0!
li display: block!
a!
padding: 6px 12px!
color: $yellow
SASS
nav {!
ul {!
margin: 0;!
}!
li {!
display: block;!
}!
a {!
padding: 6px 12px;!
color: $yellow;!
}!
}
SCSS
nav!
ul!
margin: 0!
li display: block!
a!
padding: 6px 12px!
color: $yellow
SASS
SASS Mixins
@mixin my-background($radius) {!
margin-top: 12px;!
height: 10px;!
background: red;!
border-radius: $radius;!
}
Define the mixin
.box {@include my-background(12px);}
Include the mixin
SASS Extend
%my-background {!
margin-top: 12px;!
height: 10px;!
background: red;!
border: 1px solid $yellow;!
}
Define the placeholder selector
.box {@extend %my-background;}
Extend the placeholder selector
Mixin or Extend
.box,.footer {@include my-background(12px);}
Arguments
.box,.footer {@extend %my-background;}
Smaller CSS
Resources
β€’ www.w3schools.com/css
β€’ css-tricks.com
β€’ alistapart.com
β€’ thesassway.com
Questions &
Answers
sean@zivtech.com
Assignment
github.com/sean3325/bullfrog
Intro to html, css & sass
Assignment
1. Fork it.
2. Create a branch (`git checkout -b
toms_branch`)
3. Commit your changes (`git commit -m "Fixed
Navigation Styles"`)
4. Push to the branch (`git push origin
toms_branch`)

More Related Content

PPT
Presentation on html, css
PPTX
Web Development basics with WordPress
PPTX
(Fast) Introduction to HTML & CSS
PPTX
Html
PPTX
Introduction to HTML
PPTX
Introduction to CSS
PPTX
Presentation on html, css
Web Development basics with WordPress
(Fast) Introduction to HTML & CSS
Html
Introduction to HTML
Introduction to CSS

What's hot (20)

PDF
Intro to HTML & CSS
PPTX
Introducing Cascading Style Sheets
PPTX
Complete Lecture on Css presentation
PDF
What is HTML - An Introduction to HTML (Hypertext Markup Language)
PPTX
PPTX
Html5 semantics
PPTX
Introducing CSS Grid
PPSX
Introduction to css
PPT
How Cascading Style Sheets (CSS) Works
KEY
HTML presentation for beginners
ODP
CSS Basics
PPTX
html-css
PPT
Eye catching HTML BASICS tips: Learn easily
PPSX
Html introduction
PPTX
Web html table tags
PDF
Intro to HTML and CSS basics
PDF
Web front end development introduction to html css and javascript
PPTX
Html n CSS
PDF
Html,javascript & css
PPTX
What is css
Intro to HTML & CSS
Introducing Cascading Style Sheets
Complete Lecture on Css presentation
What is HTML - An Introduction to HTML (Hypertext Markup Language)
Html5 semantics
Introducing CSS Grid
Introduction to css
How Cascading Style Sheets (CSS) Works
HTML presentation for beginners
CSS Basics
html-css
Eye catching HTML BASICS tips: Learn easily
Html introduction
Web html table tags
Intro to HTML and CSS basics
Web front end development introduction to html css and javascript
Html n CSS
Html,javascript & css
What is css
Ad

Viewers also liked (8)

PPTX
Learning HTML
PPT
Html basics
PPT
Understanding THML
PDF
Html text and formatting
PDF
Intro to css & sass
PDF
Road Show TI SENAC - HTML5 & CSS 3.0 - O que esperar da prΓ³xima web?
PPT
Html text formatting
Learning HTML
Html basics
Understanding THML
Html text and formatting
Intro to css & sass
Road Show TI SENAC - HTML5 & CSS 3.0 - O que esperar da prΓ³xima web?
Html text formatting
Ad

Similar to Intro to html, css & sass (20)

PPTX
BITM3730 9-19.pptx
PPTX
BITM3730 9-20.pptx
PDF
PDF
PPTX
WEB TECHNOLOGY Unit-2.pptx
PPTX
Journey To The Front End World - Part2 - The Cosmetic
PPTX
CSS Basics part One
PPTX
CSS tutorial chapter 1
PDF
CSS INTRODUCTION SLIDES WITH HTML CODE.pdf
PPTX
Casecading Style Sheets for Hyper Text Transfer Protocol.pptx
PPTX
UNIT 3WOP fgfufhbuiibpvihbvpihivbhibvipuuvbiuvboi
PPTX
Html and css
PPTX
Unit 2 WT-CSS.pptx web technology project
PPTX
BITM3730Week4.pptx
PPTX
Css
PPTX
Cascading style sheets
PPTX
CSS Introduction
PPTX
CSS.pptx
PPTX
Cascading style sheets
BITM3730 9-19.pptx
BITM3730 9-20.pptx
WEB TECHNOLOGY Unit-2.pptx
Journey To The Front End World - Part2 - The Cosmetic
CSS Basics part One
CSS tutorial chapter 1
CSS INTRODUCTION SLIDES WITH HTML CODE.pdf
Casecading Style Sheets for Hyper Text Transfer Protocol.pptx
UNIT 3WOP fgfufhbuiibpvihbvpihivbhibvipuuvbiuvboi
Html and css
Unit 2 WT-CSS.pptx web technology project
BITM3730Week4.pptx
Css
Cascading style sheets
CSS Introduction
CSS.pptx
Cascading style sheets

Recently uploaded (20)

PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PPTX
Module 1 - Cyber Law and Ethics 101.pptx
PDF
The New Creative Director: How AI Tools for Social Media Content Creation Are...
PDF
Triggering QUIC, presented by Geoff Huston at IETF 123
Β 
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PDF
The Internet -By the Numbers, Sri Lanka Edition
Β 
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PPTX
innovation process that make everything different.pptx
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PPTX
Funds Management Learning Material for Beg
PPTX
presentation_pfe-universite-molay-seltan.pptx
PDF
RPKI Status Update, presented by Makito Lay at IDNOG 10
Β 
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
DOCX
Unit-3 cyber security network security of internet system
PDF
πŸ’° π”πŠπ“πˆ πŠπ„πŒπ„ππ€ππ†π€π πŠπˆππ„π‘πŸ’πƒ π‡π€π‘πˆ 𝐈𝐍𝐈 πŸπŸŽπŸπŸ“ πŸ’°
Β 
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
Β 
PPTX
Slides PPTX World Game (s) Eco Economic Epochs.pptx
PPTX
Introuction about WHO-FIC in ICD-10.pptx
PPT
tcp ip networks nd ip layering assotred slides
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
SASE Traffic Flow - ZTNA Connector-1.pdf
Module 1 - Cyber Law and Ethics 101.pptx
The New Creative Director: How AI Tools for Social Media Content Creation Are...
Triggering QUIC, presented by Geoff Huston at IETF 123
Β 
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
The Internet -By the Numbers, Sri Lanka Edition
Β 
522797556-Unit-2-Temperature-measurement-1-1.pptx
innovation process that make everything different.pptx
introduction about ICD -10 & ICD-11 ppt.pptx
Funds Management Learning Material for Beg
presentation_pfe-universite-molay-seltan.pptx
RPKI Status Update, presented by Makito Lay at IDNOG 10
Β 
Job_Card_System_Styled_lorem_ipsum_.pptx
Unit-3 cyber security network security of internet system
πŸ’° π”πŠπ“πˆ πŠπ„πŒπ„ππ€ππ†π€π πŠπˆππ„π‘πŸ’πƒ π‡π€π‘πˆ 𝐈𝐍𝐈 πŸπŸŽπŸπŸ“ πŸ’°
Β 
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
Β 
Slides PPTX World Game (s) Eco Economic Epochs.pptx
Introuction about WHO-FIC in ICD-10.pptx
tcp ip networks nd ip layering assotred slides
INTERNET------BASICS-------UPDATED PPT PRESENTATION

Intro to html, css & sass

  • 1. An intro to HTML, CSS, & SASS
  • 2. Sean Wolfe sean@zivtech.com β€’ Creative Director at Zivtech in Philadelphia β€’ Designing and theming Drupal sites since 2008 β€’ UPenn, Carilion Clinic, Temple University
  • 3. β€’ A Text editor β€’ A local webserver (http://www.mamp.info/en) β€’ Github account (https://github.com) β€’ SASS (http://sass-lang.com/install) β€’ Compass (http://compass-style.org/install) β€’ Bundler (http://bundler.io) β€’ Livereload (http://livereload.com/)* ! *optional but highly recommended Tools
  • 4. β€’ HTML stands for Hyper Text Markup Language β€’ HTML is a markup language β€’ HTML documents contain HTML tags and plain text β€’ HTML documents are also called web pages What is HTML?
  • 5. β€’ HTML tags are keywords (tag names) surrounded by angle brackets like <html> β€’ HTML tags normally come in pairs like <p> and </p> β€’ The first tag in a pair is the start tag, the second tag is the end tag β€’ The end tag is written like the start tag, with a slash before the tag name β€’ Start and end tags are also called opening tags and closing tags HTML Tags
  • 6. β€’ HTML5 is the latest standard for HTML. β€’ <canvas> is an element for 2D drawing β€’ <video> and <audio> are elements for media playback β€’ HTML5 uses new content-specific elements, like <article>, <footer>, <header>, <nav>, <section HTML5
  • 10. β€’ The DOCTYPE declaration defines the document type β€’ The text between <html> and </html> describes the web page β€’ The <head> element is a container for all the head elements. β€’ The text between <body> and </body> is the visible page content β€’ The text between <h1> and </h1> is displayed as a heading β€’ The text between <p> and </p> is displayed as a paragraph Basic HTML
  • 11. β€’ The <title> tag defines the title of the document. β€’ The <link> tag defines the relationship between a document and an external resource. β€’ The <style> tag is used to define style information for an HTML document. β€’ The <meta> tag provides metadata about the HTML document. β€’ The <script> tag is used to define a client-side script, such as a JavaScript. HTML Head
  • 12. β€’ The DOCTYPE declaration defines the document type β€’ The text between <html> and </html> describes the web page β€’ The text between <body> and </body> is the visible page content β€’ The text between <h1> and </h1> is displayed as a heading β€’ The text between <p> and </p> is displayed as a paragraph Basic HTML
  • 13. HTML Headings β€’ HTML headings are defined with the <h1> to <h6> tags.
  • 14. HTML Headings β€’ HTML headings are defined with the <h1> to <h6> tags.
  • 15. HTML Paragraphs β€’ HTML paragraphs are defined with the <p> tag.
  • 16. HTML Paragraphs β€’ HTML paragraphs are defined with the <p> tag.
  • 17. HTML Links β€’ HTML links are defined with the <a> tag.
  • 18. HTML Links β€’ HTML links are defined with the <a> tag.
  • 19. HTML Images β€’ HTML images are defined with the <img> tag.
  • 20. HTML Images β€’ HTML images are defined with the <img> tag.
  • 21. HTML Lists β€’ In HTML, there are several types of lists: β€’ unordered lists - the list items are marked with bullets β€’ ordered lists - the list items are marked with numbers or letters β€’ description list - a list of terms/names, with a description of each term/name.
  • 23. β€’ CSS stands for Cascading Style Sheets β€’ Styles define how to display HTML elements β€’ CSS can solve many design problems without adding images or changing the HTML What is CSS?
  • 26. CSS Selectors β€’ CSS selectors allow you to select and manipulate HTML element(s). β€’ CSS selectors are used to "find" (or select) HTML elements based on their id, classes, types, attributes, and more.
  • 27. Types of CSS Selectors β€’ The element Selector selects elements based on the element name. (e.g. body, header, p, footer) β€’ The id Selector selects a specific element on the page and can only be used once (e.g. #main, #content, #footer) β€’ The class Selector selects elements with the specific class names and cans be reused (e.g. .wrapper, .column, .panel, .panel-pane)
  • 29. Ways to use CSS β€’ CSS can be attached to HTML in 3 ways β€’ Inline (wysiwyg for example) β€’ Embedded (placed in document <head>) β€’ Links to CSS files (the preferred method)
  • 30. Ways to use CSS <p style=β€œcolor:red;”>Some Text</p> Inline Styles
  • 31. Ways to use CSS <head>! <style>p {color:red;}</style>! </head> Embedded Styles
  • 32. Ways to use CSS <head>! <link rel="stylesheet"
 type="text/css" href=β€œstyle.css">! </head> External Style Sheet reference p {color:red;} style.css
  • 33. CSS Margin β€’ Margin is the space around elements (outside the border). β€’ The margin does not have a background color, and is completely transparent. β€’ The top, right, bottom, and left margin can be changed independently using separate properties.
  • 35. CSS Padding β€’ Padding is the space between the element border and the element content β€’ The top, right, bottom, and left padding can be changed independently using separate properties.
  • 36. {padding:25px 50px 75px 100px;} CSS Padding 25px 50px 75px 100px
  • 37. {margin:25px 50px 75px 100px;} CSS Padding & Margin {padding:25px 50px 75px 100px;}
  • 38. CSS Text β€’ color sets the color of text β€’ letter-spacing adjusts the space between characters β€’ line-height sets the distance between lines of text β€’ text-decoration specifies the decoration β€’ text-indent specifies the indentation of the first line β€’ text-shadow specifies the shadow effect β€’ text-transform controls the capitalization of text β€’ word-spacing changes the space between words
  • 39. CSS Fonts β€’ CSS font properties define the font family, boldness, size, and the style of a text. β€’ Not all computers have the same fonts installed β€’ font-family Specifies the font family for text β€’ font-size Specifies the font size of text β€’ font-style Specifies the font style for text (e.g. normal or italic) β€’ font-variant Specifies if text should be small-caps β€’ font-weight Specifies the weight of a font β€’ font Sets all the font properties in one declaration
  • 40. CSS Fonts Serif Times New Roman, Georgia Sans-serif Arial, Verdana Monospace Courier New, Lucida Console
  • 44. CSS Pseudo-classes β€’ CSS pseudo-classes are used to select the current condition of an element. β€’ The most common pseudo-classes are links β€’ Links can be styled differently depending on what state they are in. β€’ a:link Selects an unvisited link β€’ a:visited Selects visited links β€’ a:active Selects the active link β€’ a:hover Selects links on mouse over β€’ p::first-letter Selects the first letter of a paragraph β€’ p::first-line Selects the first line of a paragraph
  • 45. CSS Background β€’ CSS background properties are used to define the background effects of an element. β€’ background-color sets the background color of an element β€’ background-image sets the background image for an element β€’ background-repeat sets how a background image will be repeated β€’ background-attachment sets whether a background image is fixed or scrolls with the rest of the page β€’ background-position sets the starting position of a background image β€’ background sets all the background properties in one declaration
  • 46. CSS Positioning β€’ The CSS positioning properties allow you to position an element. β€’ Elements can be positioned using the top, bottom, left, and right properties. β€’ position:static is the default position of an element β€’ position:fixed tells an element to be positioned relative to the browser window. It will not move even if the window is scrolled β€’ position:relative tells an element to be positioned relative to its normal position. β€’ position:absolute tells an element where to be positioned relative to its parent element.
  • 48. CSS Float β€’ With CSS float, an element can be pushed to the left or right, allowing other elements to wrap around it. β€’ clear Specifies which sides of an element where other floating elements are not allowed. β€’ float Specifies whether or not a box should float to the left or right.
  • 49. img {float:none;} β€’ Vivamus dignissim nunc eleifend, commodo mi sed, aliquam ante. Donec id lacus eu lectus sollicitudin viverra. Curabitur congue ultricies elit, at euismod mauris iaculis at. Sed et dignissim ipsum. Quisque massa quam, lacinia vel urna ac, dictum lobortis justo.β€œDonec et molestie β€’ purus”. Cras et faucibus est, a viverra odio. Praesent luctus vel purus non mollis. In luctus vitae lectus quis fringilla. Curabitur porttitor justo ac dolor iaculis convallis. β€’ Vivamus dignissim nunc eleifend, commodo mi sed, aliquam ante. Donec id lacus eu lectus sollicitudin viverra. Curabitur congue ultricies elit, at euismod mauris iaculis at. Sed et dignissim ipsum. Quisque massa quam, lacinia vel urna ac, dictum lobortis justo.β€œDonec et molestie β€’ purus”. Cras et faucibus est, a viverra odio. Praesent luctus vel purus non mollis. In luctus vitae lectus quis fringilla. Curabitur porttitor justo ac dolor iaculis convallis. img {float:left;} img {float:right;} β€’ Vivamus dignissim nunc eleifend, commodo mi sed, aliquam ante. Donec id lacus eu lectus sollicitudin viverra. Curabitur congue ultricies elit, at euismod mauris iaculis at. Sed et dignissim ipsum. Quisque massa quam, lacinia vel urna ac, dictum lobortis justo.β€œDonec et molestie CSS Float
  • 50. CSS Display and Visibility β€’ The display property specifies if/how an element is displayed, and the visibility property specifies if an element should be visible or hidden. β€’ visibility:hidden hides an element, but it will still take up the same space as before. β€’ display:none hides an element, and it will not take up any space. β€’ display:inline tells an element to only take up as much width as necessary, and will not force line breaks. β€’ display:block tells an element will takes up the full width available, and will have a line break before and after it
  • 51. CSS Image Opacity / Transparency β€’ The CSS3 property for transparency is opacity. β€’ The opacity property can take a value from 0.0 - 1.0. A lower value makes the element more transparent. {opacity:0.1;} {opacity:0.5;} {opacity:1.0;}
  • 52. CSS Image Sprites β€’ An image sprite is a collection of images put into a single image. β€’ A web page with many images can take a long time to load and generates multiple server requests.
  • 53. CSS Media Types β€’ By using the @media rule, a website can have a different layout for screen, print, mobile phone, tablet, etc. β€’ all Used for all media type devices β€’ braille Used for braille tactile feedback devices β€’ print Used for printers β€’ screen Used for computer screens β€’ tv Used for television-type devices
  • 54. CSS3 β€’ CSS3 is the latest standard for CSS and is completely backwards-compatible with earlier versions of CSS. β€’ Selectors! β€’ Box Model! β€’ Borders! β€’ Text Effects! β€’ 2D/3D Transformations! β€’ Animations! β€’ Multiple Column Layout
  • 56. β€’ SASS stands for Syntactically Awesome Style Sheets β€’ Sass is a CSS preprocessor β€’ Sass can be written in either the sass or scss syntax β€’ Sass files compile into css files What is SASS?
  • 57. β€’ CSS doesn’t allow variables β€’ SASS uses mixins (reusable blocks of styles) β€’ SASS is faster, more efficient, and easier to maintain β€’ Using COMPASS with SASS allows us to write many lines of cross-browser compatible CSS in a single line of code! Why do we use SASS?
  • 58. Install Sass $ gem install sass
  • 59. nav {! ul {! margin: 0;! }! li {! display: block;! }! a {! padding: 6px 12px;! color: $yellow;! }! } SCSS nav! ul! margin: 0! li display: block! a! padding: 6px 12px! color: $yellow SASS
  • 60. nav {! ul {! margin: 0;! }! li {! display: block;! }! a {! padding: 6px 12px;! color: $yellow;! }! } SCSS nav! ul! margin: 0! li display: block! a! padding: 6px 12px! color: $yellow SASS
  • 61. SASS Mixins @mixin my-background($radius) {! margin-top: 12px;! height: 10px;! background: red;! border-radius: $radius;! } Define the mixin .box {@include my-background(12px);} Include the mixin
  • 62. SASS Extend %my-background {! margin-top: 12px;! height: 10px;! background: red;! border: 1px solid $yellow;! } Define the placeholder selector .box {@extend %my-background;} Extend the placeholder selector
  • 63. Mixin or Extend .box,.footer {@include my-background(12px);} Arguments .box,.footer {@extend %my-background;} Smaller CSS
  • 68. Assignment 1. Fork it. 2. Create a branch (`git checkout -b toms_branch`) 3. Commit your changes (`git commit -m "Fixed Navigation Styles"`) 4. Push to the branch (`git push origin toms_branch`)