Movatterモバイル変換


[0]ホーム

URL:


Heather Rock, profile picture
Uploaded byHeather Rock
3,462 views

Intro to HTML and CSS - Class 2 Slides

1. CSS stands for Cascading Style Sheets and refers to how styles are applied hierarchically to HTML elements. 2. There are three main ways to attach CSS to a webpage: inline, embedded, and linked. Linked style sheets keep the styles in a separate .css file for easy maintenance.3. CSS selectors allow targeting specific elements by HTML tag names, classes, IDs, and other attributes. Common selectors include colors, fonts, links, and compound selectors.

Embed presentation

Downloaded 86 times
BEGINNING HTML AND CSSCLASS 2HTML/CSS ~ Girl Develop It ~
CSSStands for Cascading Style Sheets.Refers to the hierarchical way that styles get applied tohtml elements.
WHAT WE'LL LEARN TODAYA little CSS history.Terminology and syntax.Ways to attach CSS to your page.Selectors.Colors and Fonts.
HISTORY OF CSSThe 90sHTML pages read from top to bottom, black font, nocolor, and all default browser styles.Fine for science papers, but designers said "WeWant More!"1993: The first graphical browser is born — "Mosaic"1994: World Wide Web Consortium is inaugurated(W3C) and the World Wide Web is born.
HISTORY OF CSSLate 90s1996: Specifications for CSS1 are released (a yearbefore HTML 4.0).CSS1 is buggy and poorly adopted.1998: W3C releases CSS2.CSS2 is buggy and poorly adopted.Meanwhile, table-based layouts and browser warsare rampant!
HISTORY OF CSSThe 00s1999 - 2000: Work is begun on CSS2.1 to fix bugs inCSS 2.2004: The working draft becomes a candidate foradoption by the W3C. It reverts back to working draftin 2005.2007: The working draft again becomes a candidatefor adoption by the W3C2010: It reverts back to a working draft.2011: June 7th, CSS2.1 is finally "sanctified" by theW3C.
HISTORY OF CSSCSS3CSS3, begun in 2000, is still mostly in working-draftstage.Modular release (rather than one single adoption).2013: Most modules still in working-draft stage...some released and adopted by modern browsers.
CSS: WHAT DOES IT LOOK LIKE?
LET'S CODE SOME CSS!<head><title>My Very First Web Page!</title><style>h1 {color: blue;background-color: yellow;}</style></head>
NOW SAVE YOUR PAGEOpen it up in a browserDoes your heading look different?
CSS TERMINOLOGY:CSS is composed of style "rules"Here is a style rule:
SYNTAX IS IMPORTANT!h1 {color: blue;background-color: yellow;}There are no limits to the number of declarations in astyle rule.Common convention is to use lower case throughout.Don't forget the semicolon at the end of thedeclarations!Don't forget the closing curly bracket!
ATTACHING CSS TO YOUR WEB PAGEThere are three waysInlineEmbeddedLinked
INLINE<p style="color: red;">Some text.</p>The style goes right inside the opening HTML tag.Uses "style", which is an HTML attribute.Difficult to use in large projects.
EMBEDDEDThis is how we did it in our opening exercise."Embedded" inside the <head> element between anopening and closing <style> tag.If styles are identical across multiple pages in your site --you'd have to copy and paste for each page.
LINKEDAll your styles go on their own style sheet!A <link> tag in your HTML file points to the location of thestyle sheet<head><title>My Very First Web Page!</title><link rel="stylesheet" type="text/css"href="style.css"></head>
ADVANTAGES OF LINKED (EXTERNAL)STYLE SHEETS:Shared resource for several pages.Reduced file size & bandwidthEasy to maintain in larger projects.
LET'S CODE IT (PART 1)1. Open a new page in your text editor.2. Copy the rule you created between the style tags onyour index.html (not the tags themselves, though).3. Paste it in your new page.4. Save your page inside the "styles" folder you createdearlier. Name it "styles.css".
LET'S CODE IT (PART 2)5. Delete the style tags and everything within them on yourindex.html page.6. In their place, code the following:<link rel="stylesheet" type="text/css"href="styles/styles.css">7. Save your index.html page and open it in a browser.Does the style still show on your page?
SELECTORSThe first item in a style rule.Describes what is being styled.h1 {color: blue;background-color: yellow;}
WHAT CAN WE USE AS SELECTORS?HTML tags.Classes and ids.Pseudo classes.Any combination of the above!
HTML TAGS:p {property: value;}This would select every paragraph element.img {property: value;}This would select every image element....but what if you need more control?
CLASSES AND IDS"Class" and "ID" are HTML attributes.Attributes "describe" elements and are followed byvalues.In your HTML, it looks like this:<p id="intro"><span class="warning">
IDS VS. CLASSESID: An id can only be used once on a page. Refers to asingular page element (like a footer).Think ~ A student ID numberClass: Lots of elements can have the same class. I.E.There can be many spans with a class of "warning".Think ~ A student as a member of a class
CLASSES<p class="warning">.warning {property: value;}A class name is preceeded by a period in your stylerule.
IDS<p id="intro">#intro {property: value;}An id name is preceeded by a pound sign in your stylerule.
NAMING YOUR CLASS OR ID:Can use letters, numbers, underscore or dash (but don'tstart with a number or a dash followed by number).No spaces — use a hyphen or underscoreCSS is case-insensitive, but the convention is to use alllowercase letters.In your HTML, class and id names are in quotes (justlike all other attribute values).
LET'S CODE IT!Add these rules to your "styles.css" file:#intro {color: blue;}.warning {color: red;}Add an id of "intro" to your first paragraph.Find a word or sentence in your "index.html" file and wrapin span tags with a class of "warning".
PSEUDO CLASSESDescribes a "current condition" of an HTML element,rather than an "attribute".Link pseudo classes are the most commonexample: a:hoverto style a link when user "hovers" over it
LINK PSEUDO CLASSESa:link ~unvisited linka:visited ~visited linka:hover ~mouse over linka:active ~activated linkIf present, a:hover must come after a:link and a:visited.If present, a:active must come after a:hover.
LET'S SPICE UP OUR LINKS!a:link {color: blue;}a:visited {color: yellow;}a:hover {color: green;}a:active {color: purple;}
COMPOUND SELECTORSCombining selectors to get really specific!p em {property: value;}Selects all em elements that are within a paragraph#intro a {property: value;}Selects all link elements in elements with an id of "intro".
LET'S ADD A COMPOUND SELECTORRULE!#intro a {font-style: italic;}
STYLING WITH COLOR AND FONTSCOLORThe color property sets the color of the font.The background-color property sets the color of thebackground.Color value can be defined in one of three ways:By a recognized color nameBy a hexadecimal valueBy an RGB value
RECOGNIZED COLOR NAMESThe 17 standard colors are:aqua, black, blue, fuchsia, gray,grey, green, lime, maroon, navy,olive, purple, red, silver, teal,white, and yellow.There are 141 named colors:http://www.w3schools.com/cssref/css_colornames.asp
HEXADECIMAL VALUESExample — color: #A53C8DA pound sign followed by three pairsThe first pair equates to red valueThe second pair equates to green valueThe third pair equates to blue value
RGB VALUESExample — color: rgb(165, 60, 141)Three comma-separated numbers from 0 to 255The first number equates to red valueThe second number equates to green valueThe third number equates to blue valueCSS3 introduces a 4th value, "a", setting opacityExample — color: rgba(165, 60, 141, 0.5)
FONT5 DIFFERENT PROPERTIES TO STYLE FONT!1. font-styleexample: font-style: italic;values: "normal", "italic", or "oblique"2. font-variantexample: font-variant: small-caps;values: "normal", "small-caps", or "inherit"
3. font-weightexample: font-weight: bold;values: "normal", "bold", "bolder", "lighter",4. font-sizeexample: font-size: 12px;values:fixed: pixels (ie 12px)relative: percents (ie 100%) and ems (ie 1.5em)
5. font-familyexample:font-family: Corbel,'Helvetica Neue', Helvetica, Arial,sans-serif;Computers don't all have the same fonts installed...soprovide alternativesSpecific to general, in a comma-separated list.Fonts with two-word names are in quotes
BONUS FONT PROPERTIES!6. text-transformexample: text-transform: uppercase;values: "capitalize", "uppercase", "lowercase", or"none"7. line-heightexample: line-height: 1.5;values: numbers, percents, pixels, or "ems"
SHORTHAND FONT DECLARATIONexample:font: italic small-caps bold 34px/150% "Times New Roman", Times, serif;font-style → font-variant → font-weight → font-size / lineheight → font-familyyou must declare at minimum the font-size and font-familyexample: font: 34px "Times New Roman", Times, serif;
LET'S CODE IT!Add the shorthand font rule to your headingh1 {font: italic bold 34px Corbel,'Helvetica Neue',Helvetica, Arial, sans-serif;}
CASCADINGStyles "cascade" down until changedp{color:blue;font-family:'Helvetica';}.red{color:red;}#special{font-family:Arial;}<p>Paragraph</p><pclass="green">Paragraph</p><pclass="red">Paragraph</p><pclass="red"id="special">Paragraph</p>
CSS PROPERTIESMany CSS properties have self-explanatory names:background-colorfont-familyfont-sizecolorwidthheighthttps://developer.mozilla.org/en-US/docs/Web/CSS/ReferenceComprehensive list of all CSS properties:
QUESTIONS??
Intro to HTML and CSS - Class 2 Slides

Recommended

PDF
HTML & CSS Masterclass
PPTX
(Fast) Introduction to HTML & CSS
KEY
HTML/CSS Lecture 1
PPT
Web Development using HTML & CSS
PDF
Week 2-intro-html
PPT
HTML & CSS Workshop Notes
PDF
Intro to HTML and CSS basics
PDF
Intro to HTML
PDF
HTML Lecture Part 1 of 2
PDF
Web Typography
ODP
Introduction of Html/css/js
ODP
Cascading Style Sheets - Part 01
PPTX
An Overview of HTML, CSS & Java Script
PDF
CSS Foundations, pt 1
PDF
Intro to HTML & CSS
PPTX
Html, CSS & Web Designing
PPTX
Introduction to HTML
PDF
HTML Foundations, pt 2
PPTX
Introduction to html course digital markerters
PDF
3 Layers of the Web - Part 1
PDF
HTML Email
PDF
Frontend Crash Course: HTML and CSS
PPTX
Basic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJS
DOCX
PHP HTML CSS Notes
PDF
Html,javascript & css
PPTX
Basics of HTML 5 for Beginners
PDF
Images on the Web
PPTX
uptu web technology unit 2 Css

More Related Content

PDF
HTML & CSS Masterclass
PPTX
(Fast) Introduction to HTML & CSS
KEY
HTML/CSS Lecture 1
PPT
Web Development using HTML & CSS
PDF
Week 2-intro-html
PPT
HTML & CSS Workshop Notes
PDF
Intro to HTML and CSS basics
HTML & CSS Masterclass
(Fast) Introduction to HTML & CSS
HTML/CSS Lecture 1
Web Development using HTML & CSS
Week 2-intro-html
HTML & CSS Workshop Notes
Intro to HTML and CSS basics

What's hot

PDF
Intro to HTML
PDF
HTML Lecture Part 1 of 2
PDF
Web Typography
ODP
Introduction of Html/css/js
ODP
Cascading Style Sheets - Part 01
PPTX
An Overview of HTML, CSS & Java Script
PDF
CSS Foundations, pt 1
PDF
Intro to HTML & CSS
PPTX
Html, CSS & Web Designing
PPTX
Introduction to HTML
PDF
HTML Foundations, pt 2
PPTX
Introduction to html course digital markerters
PDF
3 Layers of the Web - Part 1
PDF
HTML Email
PDF
Frontend Crash Course: HTML and CSS
PPTX
Basic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJS
DOCX
PHP HTML CSS Notes
PDF
Html,javascript & css
PPTX
Basics of HTML 5 for Beginners
PDF
Images on the Web
Intro to HTML
HTML Lecture Part 1 of 2
Web Typography
Introduction of Html/css/js
Cascading Style Sheets - Part 01
An Overview of HTML, CSS & Java Script
CSS Foundations, pt 1
Intro to HTML & CSS
Html, CSS & Web Designing
Introduction to HTML
HTML Foundations, pt 2
Introduction to html course digital markerters
3 Layers of the Web - Part 1
HTML Email
Frontend Crash Course: HTML and CSS
Basic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJS
PHP HTML CSS Notes
Html,javascript & css
Basics of HTML 5 for Beginners
Images on the Web

Similar to Intro to HTML and CSS - Class 2 Slides

PPTX
uptu web technology unit 2 Css
PPT
Unit 2-CSS & Bootstrap.ppt
PPT
Shyam sunder Rajasthan Computer
PPTX
Embrace the Mullet: CSS is the 'Party in the Back' (a CSS How-to)
PDF
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
PPTX
Web technologies-course 03.pptx
PPTX
CSS
PPSX
Introduction to css
PPT
Make Css easy(part:2) : easy tips for css(part:2)
PPT
CSS Training in Bangalore
PDF
css-tutorial
PDF
css-tutorial
PPTX
Internet tech &amp; web prog. p4,5
PDF
The CSS Handbook
PPT
Css siva
PPT
Css siva
PDF
PPTX
Css types internal, external and inline (1)
uptu web technology unit 2 Css
Unit 2-CSS & Bootstrap.ppt
Shyam sunder Rajasthan Computer
Embrace the Mullet: CSS is the 'Party in the Back' (a CSS How-to)
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Web technologies-course 03.pptx
CSS
Introduction to css
Make Css easy(part:2) : easy tips for css(part:2)
CSS Training in Bangalore
css-tutorial
css-tutorial
Internet tech &amp; web prog. p4,5
The CSS Handbook
Css siva
Css siva
Css types internal, external and inline (1)

More from Heather Rock

PDF
GDI Seattle - Web Accessibility Class 1
PDF
GDI Seattle - Intro to JavaScript Class 4
PDF
GDI Seattle - Intro to JavaScript Class 2
PDF
GDI Seattle - Intro to JavaScript Class 1
PDF
GDI Seattle Intro to HTML and CSS - Class 4
PDF
GDI Seattle - Intermediate HTML and CSS Class 3 Slides
PDF
GDI Seattle Intro to HTML and CSS - Class 3
PDF
GDI Seattle Intermediate HTML and CSS Class 1
PDF
GDI Seattle Intro to HTML and CSS - Class 1
GDI Seattle - Web Accessibility Class 1
GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 2
GDI Seattle - Intro to JavaScript Class 1
GDI Seattle Intro to HTML and CSS - Class 4
GDI Seattle - Intermediate HTML and CSS Class 3 Slides
GDI Seattle Intro to HTML and CSS - Class 3
GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intro to HTML and CSS - Class 1

Recently uploaded

PPTX
Software Analysis &Design ethiopia chap-2.pptx
PDF
Session 1 - Solving Semi-Structured Documents with Document Understanding
PDF
Eredità digitale sugli smartphone: cosa resta di noi nei dispositivi mobili
PDF
Vibe Coding vs. Spec-Driven Development [Free Meetup]
DOCX
iRobot Post‑Mortem and Alternative Paths - Discussion Document for Boards and...
PPTX
Data Privacy and Protection: Safeguarding Information in a Connected World
PDF
Usage Control for Process Discovery through a Trusted Execution Environment
PPTX
AI's Impact on Cybersecurity - Challenges and Opportunities
PDF
ElyriaSoftware — Powering the Future with Blockchain Innovation
PPTX
wob-report.pptxwob-report.pptxwob-report.pptx
PDF
Day 3 - Data and Application Security - 2nd Sight Lab Cloud Security Class
PPTX
cybercrime in Information security .pptx
PDF
Day 1 - Cloud Security Strategy and Planning ~ 2nd Sight Lab ~ Cloud Security...
PPTX
Building Cyber Resilience for 2026: Best Practices for a Secure, AI-Driven Bu...
PDF
Digit Expo 2025 - EICC Edinburgh 27th November
PPTX
Protecting Data in an AI Driven World - Cybersecurity in 2026
PPTX
Cybercrime in the Digital Age: Risks, Impact & Protection
PDF
Security Forum Sessions from Houston 2025 Event
PDF
December Patch Tuesday
 
PPTX
Kanban India 2025 | Daksh Gupta | Modeling the Models, Generative AI & Kanban
Software Analysis &Design ethiopia chap-2.pptx
Session 1 - Solving Semi-Structured Documents with Document Understanding
Eredità digitale sugli smartphone: cosa resta di noi nei dispositivi mobili
Vibe Coding vs. Spec-Driven Development [Free Meetup]
iRobot Post‑Mortem and Alternative Paths - Discussion Document for Boards and...
Data Privacy and Protection: Safeguarding Information in a Connected World
Usage Control for Process Discovery through a Trusted Execution Environment
AI's Impact on Cybersecurity - Challenges and Opportunities
ElyriaSoftware — Powering the Future with Blockchain Innovation
wob-report.pptxwob-report.pptxwob-report.pptx
Day 3 - Data and Application Security - 2nd Sight Lab Cloud Security Class
cybercrime in Information security .pptx
Day 1 - Cloud Security Strategy and Planning ~ 2nd Sight Lab ~ Cloud Security...
Building Cyber Resilience for 2026: Best Practices for a Secure, AI-Driven Bu...
Digit Expo 2025 - EICC Edinburgh 27th November
Protecting Data in an AI Driven World - Cybersecurity in 2026
Cybercrime in the Digital Age: Risks, Impact & Protection
Security Forum Sessions from Houston 2025 Event
December Patch Tuesday
 
Kanban India 2025 | Daksh Gupta | Modeling the Models, Generative AI & Kanban

Intro to HTML and CSS - Class 2 Slides

  • 1.
    BEGINNING HTML ANDCSSCLASS 2HTML/CSS ~ Girl Develop It ~
  • 3.
    CSSStands for CascadingStyle Sheets.Refers to the hierarchical way that styles get applied tohtml elements.
  • 4.
    WHAT WE'LL LEARNTODAYA little CSS history.Terminology and syntax.Ways to attach CSS to your page.Selectors.Colors and Fonts.
  • 5.
    HISTORY OF CSSThe90sHTML pages read from top to bottom, black font, nocolor, and all default browser styles.Fine for science papers, but designers said "WeWant More!"1993: The first graphical browser is born — "Mosaic"1994: World Wide Web Consortium is inaugurated(W3C) and the World Wide Web is born.
  • 6.
    HISTORY OF CSSLate90s1996: Specifications for CSS1 are released (a yearbefore HTML 4.0).CSS1 is buggy and poorly adopted.1998: W3C releases CSS2.CSS2 is buggy and poorly adopted.Meanwhile, table-based layouts and browser warsare rampant!
  • 7.
    HISTORY OF CSSThe00s1999 - 2000: Work is begun on CSS2.1 to fix bugs inCSS 2.2004: The working draft becomes a candidate foradoption by the W3C. It reverts back to working draftin 2005.2007: The working draft again becomes a candidatefor adoption by the W3C2010: It reverts back to a working draft.2011: June 7th, CSS2.1 is finally "sanctified" by theW3C.
  • 8.
    HISTORY OF CSSCSS3CSS3,begun in 2000, is still mostly in working-draftstage.Modular release (rather than one single adoption).2013: Most modules still in working-draft stage...some released and adopted by modern browsers.
  • 9.
    CSS: WHAT DOESIT LOOK LIKE?
  • 11.
    LET'S CODE SOMECSS!<head><title>My Very First Web Page!</title><style>h1 {color: blue;background-color: yellow;}</style></head>
  • 12.
    NOW SAVE YOURPAGEOpen it up in a browserDoes your heading look different?
  • 13.
    CSS TERMINOLOGY:CSS iscomposed of style "rules"Here is a style rule:
  • 14.
    SYNTAX IS IMPORTANT!h1{color: blue;background-color: yellow;}There are no limits to the number of declarations in astyle rule.Common convention is to use lower case throughout.Don't forget the semicolon at the end of thedeclarations!Don't forget the closing curly bracket!
  • 15.
    ATTACHING CSS TOYOUR WEB PAGEThere are three waysInlineEmbeddedLinked
  • 16.
    INLINE<p style="color: red;">Sometext.</p>The style goes right inside the opening HTML tag.Uses "style", which is an HTML attribute.Difficult to use in large projects.
  • 17.
    EMBEDDEDThis is howwe did it in our opening exercise."Embedded" inside the <head> element between anopening and closing <style> tag.If styles are identical across multiple pages in your site --you'd have to copy and paste for each page.
  • 18.
    LINKEDAll your stylesgo on their own style sheet!A <link> tag in your HTML file points to the location of thestyle sheet<head><title>My Very First Web Page!</title><link rel="stylesheet" type="text/css"href="style.css"></head>
  • 19.
    ADVANTAGES OF LINKED(EXTERNAL)STYLE SHEETS:Shared resource for several pages.Reduced file size & bandwidthEasy to maintain in larger projects.
  • 20.
    LET'S CODE IT(PART 1)1. Open a new page in your text editor.2. Copy the rule you created between the style tags onyour index.html (not the tags themselves, though).3. Paste it in your new page.4. Save your page inside the "styles" folder you createdearlier. Name it "styles.css".
  • 21.
    LET'S CODE IT(PART 2)5. Delete the style tags and everything within them on yourindex.html page.6. In their place, code the following:<link rel="stylesheet" type="text/css"href="styles/styles.css">7. Save your index.html page and open it in a browser.Does the style still show on your page?
  • 22.
    SELECTORSThe first itemin a style rule.Describes what is being styled.h1 {color: blue;background-color: yellow;}
  • 23.
    WHAT CAN WEUSE AS SELECTORS?HTML tags.Classes and ids.Pseudo classes.Any combination of the above!
  • 24.
    HTML TAGS:p {property:value;}This would select every paragraph element.img {property: value;}This would select every image element....but what if you need more control?
  • 25.
    CLASSES AND IDS"Class"and "ID" are HTML attributes.Attributes "describe" elements and are followed byvalues.In your HTML, it looks like this:<p id="intro"><span class="warning">
  • 26.
    IDS VS. CLASSESID:An id can only be used once on a page. Refers to asingular page element (like a footer).Think ~ A student ID numberClass: Lots of elements can have the same class. I.E.There can be many spans with a class of "warning".Think ~ A student as a member of a class
  • 27.
    CLASSES<p class="warning">.warning {property:value;}A class name is preceeded by a period in your stylerule.
  • 28.
    IDS<p id="intro">#intro {property:value;}An id name is preceeded by a pound sign in your stylerule.
  • 29.
    NAMING YOUR CLASSOR ID:Can use letters, numbers, underscore or dash (but don'tstart with a number or a dash followed by number).No spaces — use a hyphen or underscoreCSS is case-insensitive, but the convention is to use alllowercase letters.In your HTML, class and id names are in quotes (justlike all other attribute values).
  • 30.
    LET'S CODE IT!Addthese rules to your "styles.css" file:#intro {color: blue;}.warning {color: red;}Add an id of "intro" to your first paragraph.Find a word or sentence in your "index.html" file and wrapin span tags with a class of "warning".
  • 32.
    PSEUDO CLASSESDescribes a"current condition" of an HTML element,rather than an "attribute".Link pseudo classes are the most commonexample: a:hoverto style a link when user "hovers" over it
  • 33.
    LINK PSEUDO CLASSESa:link~unvisited linka:visited ~visited linka:hover ~mouse over linka:active ~activated linkIf present, a:hover must come after a:link and a:visited.If present, a:active must come after a:hover.
  • 34.
    LET'S SPICE UPOUR LINKS!a:link {color: blue;}a:visited {color: yellow;}a:hover {color: green;}a:active {color: purple;}
  • 35.
    COMPOUND SELECTORSCombining selectorsto get really specific!p em {property: value;}Selects all em elements that are within a paragraph#intro a {property: value;}Selects all link elements in elements with an id of "intro".
  • 36.
    LET'S ADD ACOMPOUND SELECTORRULE!#intro a {font-style: italic;}
  • 37.
    STYLING WITH COLORAND FONTSCOLORThe color property sets the color of the font.The background-color property sets the color of thebackground.Color value can be defined in one of three ways:By a recognized color nameBy a hexadecimal valueBy an RGB value
  • 38.
    RECOGNIZED COLOR NAMESThe17 standard colors are:aqua, black, blue, fuchsia, gray,grey, green, lime, maroon, navy,olive, purple, red, silver, teal,white, and yellow.There are 141 named colors:http://www.w3schools.com/cssref/css_colornames.asp
  • 39.
    HEXADECIMAL VALUESExample —color: #A53C8DA pound sign followed by three pairsThe first pair equates to red valueThe second pair equates to green valueThe third pair equates to blue value
  • 40.
    RGB VALUESExample —color: rgb(165, 60, 141)Three comma-separated numbers from 0 to 255The first number equates to red valueThe second number equates to green valueThe third number equates to blue valueCSS3 introduces a 4th value, "a", setting opacityExample — color: rgba(165, 60, 141, 0.5)
  • 41.
    FONT5 DIFFERENT PROPERTIESTO STYLE FONT!1. font-styleexample: font-style: italic;values: "normal", "italic", or "oblique"2. font-variantexample: font-variant: small-caps;values: "normal", "small-caps", or "inherit"
  • 42.
    3. font-weightexample: font-weight:bold;values: "normal", "bold", "bolder", "lighter",4. font-sizeexample: font-size: 12px;values:fixed: pixels (ie 12px)relative: percents (ie 100%) and ems (ie 1.5em)
  • 43.
    5. font-familyexample:font-family: Corbel,'HelveticaNeue', Helvetica, Arial,sans-serif;Computers don't all have the same fonts installed...soprovide alternativesSpecific to general, in a comma-separated list.Fonts with two-word names are in quotes
  • 44.
    BONUS FONT PROPERTIES!6.text-transformexample: text-transform: uppercase;values: "capitalize", "uppercase", "lowercase", or"none"7. line-heightexample: line-height: 1.5;values: numbers, percents, pixels, or "ems"
  • 45.
    SHORTHAND FONT DECLARATIONexample:font:italic small-caps bold 34px/150% "Times New Roman", Times, serif;font-style → font-variant → font-weight → font-size / lineheight → font-familyyou must declare at minimum the font-size and font-familyexample: font: 34px "Times New Roman", Times, serif;
  • 46.
    LET'S CODE IT!Addthe shorthand font rule to your headingh1 {font: italic bold 34px Corbel,'Helvetica Neue',Helvetica, Arial, sans-serif;}
  • 47.
    CASCADINGStyles "cascade" downuntil changedp{color:blue;font-family:'Helvetica';}.red{color:red;}#special{font-family:Arial;}<p>Paragraph</p><pclass="green">Paragraph</p><pclass="red">Paragraph</p><pclass="red"id="special">Paragraph</p>
  • 48.
    CSS PROPERTIESMany CSSproperties have self-explanatory names:background-colorfont-familyfont-sizecolorwidthheighthttps://developer.mozilla.org/en-US/docs/Web/CSS/ReferenceComprehensive list of all CSS properties:
  • 49.

[8]ページ先頭

©2009-2025 Movatter.jp