SlideShare a Scribd company logo
TMW Code Club
TMW Code Club
Week 2: CSS – The fundamentals
TMW Code Club
Do you know more than
this guy?
TMW Code Club
Recap
TMW Code Club
HTML, CSS, JavaScriptContent Styling Behaviour
Text, images, video
Colours, borders,
backgrounds, shadows
Click, touch,
scroll, hover
TMW Code Club
Week 2
CSS – The basics
• The cascade
• Importance, specificity and source order
• Classes and IDs
• CSS properties and terminology
TMW Code Club
CSS
Cascading Style Sheets
TMW Code Club
By combining importance, origin, specificity, and
the source order of the style concerned, the CSS
cascade assigns a weight to each declaration. This
weight is used to determine exactly, and without
conflict, which style declarations should be applied
to a specific element: the declaration with the
highest weight takes precedence.
What is this cascade?
http://reference.sitepoint.com/css/cascade
7
TMW Code Club
By combining importance, origin, specificity, and
the source order of the style concerned, the CSS
cascade assigns a weight to each declaration. This
weight is used to determine exactly, and without
conflict, which style declarations should be applied
to a specific element: the declaration with the
highest weight takes precedence.
What is this cascade?
http://reference.sitepoint.com/css/cascade
8
TMW Code Club
Remember this?
TMW Code Club
What happens here?
TMW Code Club
Let’s try it for real
codepen.io/mrmartineau/pen/nfDcE
TMW Code Club
Selectors
• Element
• Classes
• IDs
• Complex selectors
TMW Code Club
Element selectors
• Matches elements with the corresponding
element type name
• Quite general and not very specific.
TMW Code Club
What are classes and IDs?
When there are more than one of a given element
on the page, and you need to look different, you
will need to use classes and IDs.
<div></div>
!
<div id=“foo”></div>
!
<div class=“bar”></div>
Element:
!
ID:
!
Class:
TMW Code Club
What are classes and IDs?
• IDs are unique. Only one allowed per page.
• Multiple classes can be used per page &
elements can even have multiple classes
<div></div>
!
<div id=“foo”></div>
!
<div class=“bar”></div>
Element:
!
ID:
!
Class:
TMW Code Club
ID selectors
Matches an element that has a specific id attribute
value. Since id attributes must have unique values,
an ID selector can never match more than one
element in a document.
TMW Code Club
Class selectors
Less specific than an ID because they are not unique
TMW Code Club
More complex selectors
Siblings, Children and descendent selectors
TMW Code Club
Selector examples
codepen.io/mrmartineau/pen/jgCvq
TMW Code Club
CSS Properties
Basic Styling
TMW Code Club
color
(or colour)
TMW Code Club
color
(or colour)
The color property sets the text colour of an
elements content, and it’s decorations (such as
underlines, or line throughs).
More info: https://developer.mozilla.org/en-US/docs/Web/CSS/color
TMW Code Club
color
(or colour)
Colours in CSS can be defined in a number of ways.
To set our text colour to black, we could define it…
!
…as a hex code = #000 = #000000
…an RGB value = rgb(0, 0, 0)
…an hsl value = hsl(0%, 0%, 0%)
…or using the reserved CSS keyword ‘black’
More info: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
TMW Code Club
color
(or colour)
You can also set colours for the following properties:
!
background-color!
color!
border-color!
TMW Code Club
color example
codepen.io/ashleynolan/pen/Blnkc
TMW Code Club
background
TMW Code Club
background
The background property allows you to control the
background of any element.
More info: https://developer.mozilla.org/en-US/docs/Web/CSS/background
TMW Code Club
background
Can be an image:
background-image: url(‘myimage.png’);!
!
or a color, as mentioned before:
background-color: #fff;
More info: https://developer.mozilla.org/en-US/docs/Web/CSS/background
TMW Code Club
background
Some properties have a shortcut alternative, in
which you can specify multiple properties at once.
!
background-color: #fff;!
background-image: url(‘myimage.png’);!
becomes
background: #fff url(‘myimage.png’);
More info: https://developer.mozilla.org/en-US/docs/Web/CSS/background
TMW Code Club
background
background also has other properties
!
background-image!
background-position!
background-repeat!
background-color
More info: https://developer.mozilla.org/en-US/docs/Web/CSS/background
TMW Code Club
background example
http://codepen.io/ashleynolan/pen/dxocr
TMW Code Club
text properties
TMW Code Club
text properties
Text has a number of CSS properties that can be applied.
More info: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/font-size
TMW Code Club
font-size
text properties
font-size can be defined in px
(as well as a few other ways which we‘ll get to in a later lesson)
!
font-size: 16px;
More info: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/font-size
TMW Code Club
line-height
text properties
line-height can also be defined in px, but can also be
unitless, which is relative to the font-size
!
line-height: 16px;!
or
line-height: 1.5;!
where the line-height is multiplied by the font-size
More info: https://developer.mozilla.org/en-US/docs/Web/CSS/line-height
TMW Code Club
text decoration
text properties
Text can be given a text-decoration
!
So for example, links (<a> tags) have the following by default:
!
text-decoration: underline;!
!
It takes the following values:
underline, line-through or overline!
More info: https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration
TMW Code Club
text shadow
text properties
Text can also be given a shadow
!
text-shadow: 0 -2px #000;
More info: https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow
TMW Code Club
text examples
Text decoration: codepen.io/ashleynolan/pen/pxnCc
!
Text shadow: codepen.io/ashleynolan/pen/zrLlv
!
Text shadow example: codepen.io/juanbrujo/pen/yGpAK
TMW Code Club
Homework!
Style up the earlier codepen example to have a custom
styled title and paragraph text. Use any of the CSS
properties we've seen today.
!
http://codepen.io/ashleynolan/pen/Blnkc
Ad

More Related Content

What's hot (20)

Jquery News Packages
Jquery News PackagesJquery News Packages
Jquery News Packages
UC Berkeley Graduate School of Journalism
 
WordCamp Kent 2019 - WP 101: Custom Post Type & Custom Fields
WordCamp Kent 2019 - WP 101: Custom Post Type & Custom FieldsWordCamp Kent 2019 - WP 101: Custom Post Type & Custom Fields
WordCamp Kent 2019 - WP 101: Custom Post Type & Custom Fields
Joe Querin
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress Developers
Suzette Franck
 
OOCSS, SMACSS or BEM?
OOCSS, SMACSS or BEM?OOCSS, SMACSS or BEM?
OOCSS, SMACSS or BEM?
Michael Posso
 
How to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - SacramentoHow to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - Sacramento
Suzette Franck
 
Wp responsive-theme-framework
Wp responsive-theme-frameworkWp responsive-theme-framework
Wp responsive-theme-framework
Damien Oh
 
An Introduction to Custom Post Types
An Introduction to Custom Post TypesAn Introduction to Custom Post Types
An Introduction to Custom Post Types
Carleton Web Services
 
Wrangling Themes: everything you need to know about WordPress themes
Wrangling Themes: everything you need to know about WordPress themesWrangling Themes: everything you need to know about WordPress themes
Wrangling Themes: everything you need to know about WordPress themes
Alison Knott
 
Wrangling Themes: everything you need to know about WordPress themes
Wrangling Themes: everything you need to know about WordPress themesWrangling Themes: everything you need to know about WordPress themes
Wrangling Themes: everything you need to know about WordPress themes
Alison Knott
 
Intro to css & sass
Intro to css & sassIntro to css & sass
Intro to css & sass
Sean Wolfe
 
How to use CSS3 in WordPress
How to use CSS3 in WordPressHow to use CSS3 in WordPress
How to use CSS3 in WordPress
Suzette Franck
 
Internet tech &amp; web prog. p4,5
Internet tech &amp; web prog.  p4,5Internet tech &amp; web prog.  p4,5
Internet tech &amp; web prog. p4,5
Taymoor Nazmy
 
Word press course
Word press courseWord press course
Word press course
Judith Gotwald
 
Trendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondTrendsetting: Web Design and Beyond
Trendsetting: Web Design and Beyond
Andy Stratton
 
Sass: The Future of Stylesheets
Sass: The Future of StylesheetsSass: The Future of Stylesheets
Sass: The Future of Stylesheets
chriseppstein
 
Word press bootcamp By Sourcescript Innovations and Mentors Dojo
Word press bootcamp  By Sourcescript Innovations and Mentors DojoWord press bootcamp  By Sourcescript Innovations and Mentors Dojo
Word press bootcamp By Sourcescript Innovations and Mentors Dojo
lightshire
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
Doris Chen
 
Intro to CSS3
Intro to CSS3Intro to CSS3
Intro to CSS3
Denise Jacobs
 
Css 3
Css 3Css 3
Css 3
poollar
 
Css 3
Css 3Css 3
Css 3
poollar
 
WordCamp Kent 2019 - WP 101: Custom Post Type & Custom Fields
WordCamp Kent 2019 - WP 101: Custom Post Type & Custom FieldsWordCamp Kent 2019 - WP 101: Custom Post Type & Custom Fields
WordCamp Kent 2019 - WP 101: Custom Post Type & Custom Fields
Joe Querin
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress Developers
Suzette Franck
 
OOCSS, SMACSS or BEM?
OOCSS, SMACSS or BEM?OOCSS, SMACSS or BEM?
OOCSS, SMACSS or BEM?
Michael Posso
 
How to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - SacramentoHow to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - Sacramento
Suzette Franck
 
Wp responsive-theme-framework
Wp responsive-theme-frameworkWp responsive-theme-framework
Wp responsive-theme-framework
Damien Oh
 
An Introduction to Custom Post Types
An Introduction to Custom Post TypesAn Introduction to Custom Post Types
An Introduction to Custom Post Types
Carleton Web Services
 
Wrangling Themes: everything you need to know about WordPress themes
Wrangling Themes: everything you need to know about WordPress themesWrangling Themes: everything you need to know about WordPress themes
Wrangling Themes: everything you need to know about WordPress themes
Alison Knott
 
Wrangling Themes: everything you need to know about WordPress themes
Wrangling Themes: everything you need to know about WordPress themesWrangling Themes: everything you need to know about WordPress themes
Wrangling Themes: everything you need to know about WordPress themes
Alison Knott
 
Intro to css & sass
Intro to css & sassIntro to css & sass
Intro to css & sass
Sean Wolfe
 
How to use CSS3 in WordPress
How to use CSS3 in WordPressHow to use CSS3 in WordPress
How to use CSS3 in WordPress
Suzette Franck
 
Internet tech &amp; web prog. p4,5
Internet tech &amp; web prog.  p4,5Internet tech &amp; web prog.  p4,5
Internet tech &amp; web prog. p4,5
Taymoor Nazmy
 
Trendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondTrendsetting: Web Design and Beyond
Trendsetting: Web Design and Beyond
Andy Stratton
 
Sass: The Future of Stylesheets
Sass: The Future of StylesheetsSass: The Future of Stylesheets
Sass: The Future of Stylesheets
chriseppstein
 
Word press bootcamp By Sourcescript Innovations and Mentors Dojo
Word press bootcamp  By Sourcescript Innovations and Mentors DojoWord press bootcamp  By Sourcescript Innovations and Mentors Dojo
Word press bootcamp By Sourcescript Innovations and Mentors Dojo
lightshire
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
Doris Chen
 

Viewers also liked (18)

Navapalos tomo I
Navapalos tomo INavapalos tomo I
Navapalos tomo I
clarysml32i
 
Scaling Responsively
Scaling ResponsivelyScaling Responsively
Scaling Responsively
nolly00
 
Exploring Our Front-End Workflows
Exploring Our Front-End WorkflowsExploring Our Front-End Workflows
Exploring Our Front-End Workflows
nolly00
 
Developing for the Unknown
Developing for the UnknownDeveloping for the Unknown
Developing for the Unknown
nolly00
 
Questions that we are afraid to ask...
Questions that we are afraid to ask... Questions that we are afraid to ask...
Questions that we are afraid to ask...
TezLaguna
 
tcp atau ip
tcp atau iptcp atau ip
tcp atau ip
Syahroni Achmad
 
Jack
JackJack
Jack
yajenel
 
Family
FamilyFamily
Family
TezLaguna
 
TMW Code Club Session 1
TMW Code Club Session 1TMW Code Club Session 1
TMW Code Club Session 1
nolly00
 
Think Before You Speak
Think Before You SpeakThink Before You Speak
Think Before You Speak
TezLaguna
 
Schools, families, and communities week one
Schools, families, and communities week oneSchools, families, and communities week one
Schools, families, and communities week one
Amy Dikkers
 
Reported speech
Reported speechReported speech
Reported speech
IACO80
 
Sand and Stone
Sand and StoneSand and Stone
Sand and Stone
TezLaguna
 
CSS Best Practices
CSS Best PracticesCSS Best Practices
CSS Best Practices
nolly00
 
The Lion and the Rabbit
The Lion and the RabbitThe Lion and the Rabbit
The Lion and the Rabbit
TezLaguna
 
The Most Beautiful Heart
The Most Beautiful HeartThe Most Beautiful Heart
The Most Beautiful Heart
TezLaguna
 
Reworking our-workflows
Reworking our-workflowsReworking our-workflows
Reworking our-workflows
nolly00
 
Scissor bite
Scissor biteScissor bite
Scissor bite
mohamed eid
 
Navapalos tomo I
Navapalos tomo INavapalos tomo I
Navapalos tomo I
clarysml32i
 
Scaling Responsively
Scaling ResponsivelyScaling Responsively
Scaling Responsively
nolly00
 
Exploring Our Front-End Workflows
Exploring Our Front-End WorkflowsExploring Our Front-End Workflows
Exploring Our Front-End Workflows
nolly00
 
Developing for the Unknown
Developing for the UnknownDeveloping for the Unknown
Developing for the Unknown
nolly00
 
Questions that we are afraid to ask...
Questions that we are afraid to ask... Questions that we are afraid to ask...
Questions that we are afraid to ask...
TezLaguna
 
TMW Code Club Session 1
TMW Code Club Session 1TMW Code Club Session 1
TMW Code Club Session 1
nolly00
 
Think Before You Speak
Think Before You SpeakThink Before You Speak
Think Before You Speak
TezLaguna
 
Schools, families, and communities week one
Schools, families, and communities week oneSchools, families, and communities week one
Schools, families, and communities week one
Amy Dikkers
 
Reported speech
Reported speechReported speech
Reported speech
IACO80
 
Sand and Stone
Sand and StoneSand and Stone
Sand and Stone
TezLaguna
 
CSS Best Practices
CSS Best PracticesCSS Best Practices
CSS Best Practices
nolly00
 
The Lion and the Rabbit
The Lion and the RabbitThe Lion and the Rabbit
The Lion and the Rabbit
TezLaguna
 
The Most Beautiful Heart
The Most Beautiful HeartThe Most Beautiful Heart
The Most Beautiful Heart
TezLaguna
 
Reworking our-workflows
Reworking our-workflowsReworking our-workflows
Reworking our-workflows
nolly00
 
Ad

Similar to TMW Code Club – Session 2 - CSS Basics (20)

CSS Methodology
CSS MethodologyCSS Methodology
CSS Methodology
Zohar Arad
 
Even faster web sites presentation 3
Even faster web sites presentation 3Even faster web sites presentation 3
Even faster web sites presentation 3
Felipe Lavín
 
introductiontohtmlcss-part2-120711042239-phpapp02.ppt
introductiontohtmlcss-part2-120711042239-phpapp02.pptintroductiontohtmlcss-part2-120711042239-phpapp02.ppt
introductiontohtmlcss-part2-120711042239-phpapp02.ppt
SherwinSangalang3
 
introduction to css cascading style sheets
introduction to css cascading style sheetsintroduction to css cascading style sheets
introduction to css cascading style sheets
SherwinSangalang3
 
CSS101 - Concept Fundamentals for non UI Developers
CSS101 - Concept Fundamentals for non UI DevelopersCSS101 - Concept Fundamentals for non UI Developers
CSS101 - Concept Fundamentals for non UI Developers
Darren Gideon
 
CSS workshop @ OutSystems
CSS workshop @ OutSystemsCSS workshop @ OutSystems
CSS workshop @ OutSystems
Ruben Goncalves
 
Web
WebWeb
Web
Sreejith Ramakrishnan
 
css.ppt
css.pptcss.ppt
css.ppt
DakshPratapSingh1
 
css.ppt
css.pptcss.ppt
css.ppt
Sana903754
 
HTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptHTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.ppt
raghavanp4
 
Rational HATS and CSS
Rational HATS and CSSRational HATS and CSS
Rational HATS and CSS
Strongback Consulting
 
Css Founder.com | Cssfounder org
Css Founder.com | Cssfounder orgCss Founder.com | Cssfounder org
Css Founder.com | Cssfounder org
Css Founder
 
Css basics
Css basicsCss basics
Css basics
ASIT
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
Amit Tyagi
 
9- Learn CSS Fundamentals / Pseudo-classes
9- Learn CSS Fundamentals / Pseudo-classes9- Learn CSS Fundamentals / Pseudo-classes
9- Learn CSS Fundamentals / Pseudo-classes
In a Rocket
 
An Introduction to CSS
An Introduction to CSSAn Introduction to CSS
An Introduction to CSS
John Catterfeld
 
CSS: How To Learn Easily
CSS: How To Learn EasilyCSS: How To Learn Easily
CSS: How To Learn Easily
shabab shihan
 
NEPA BlogCon 2013 - WordPress Customization & Security
NEPA BlogCon 2013 - WordPress Customization & SecurityNEPA BlogCon 2013 - WordPress Customization & Security
NEPA BlogCon 2013 - WordPress Customization & Security
Michelle Davies (Hryvnak)
 
css v1 guru
css v1 gurucss v1 guru
css v1 guru
GuruPada Das
 
Css week11 2020 2021 for g10 by eng.osama ghandour
Css week11 2020 2021 for g10 by eng.osama ghandourCss week11 2020 2021 for g10 by eng.osama ghandour
Css week11 2020 2021 for g10 by eng.osama ghandour
Osama Ghandour Geris
 
CSS Methodology
CSS MethodologyCSS Methodology
CSS Methodology
Zohar Arad
 
Even faster web sites presentation 3
Even faster web sites presentation 3Even faster web sites presentation 3
Even faster web sites presentation 3
Felipe Lavín
 
introductiontohtmlcss-part2-120711042239-phpapp02.ppt
introductiontohtmlcss-part2-120711042239-phpapp02.pptintroductiontohtmlcss-part2-120711042239-phpapp02.ppt
introductiontohtmlcss-part2-120711042239-phpapp02.ppt
SherwinSangalang3
 
introduction to css cascading style sheets
introduction to css cascading style sheetsintroduction to css cascading style sheets
introduction to css cascading style sheets
SherwinSangalang3
 
CSS101 - Concept Fundamentals for non UI Developers
CSS101 - Concept Fundamentals for non UI DevelopersCSS101 - Concept Fundamentals for non UI Developers
CSS101 - Concept Fundamentals for non UI Developers
Darren Gideon
 
CSS workshop @ OutSystems
CSS workshop @ OutSystemsCSS workshop @ OutSystems
CSS workshop @ OutSystems
Ruben Goncalves
 
HTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptHTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.ppt
raghavanp4
 
Css Founder.com | Cssfounder org
Css Founder.com | Cssfounder orgCss Founder.com | Cssfounder org
Css Founder.com | Cssfounder org
Css Founder
 
Css basics
Css basicsCss basics
Css basics
ASIT
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
Amit Tyagi
 
9- Learn CSS Fundamentals / Pseudo-classes
9- Learn CSS Fundamentals / Pseudo-classes9- Learn CSS Fundamentals / Pseudo-classes
9- Learn CSS Fundamentals / Pseudo-classes
In a Rocket
 
CSS: How To Learn Easily
CSS: How To Learn EasilyCSS: How To Learn Easily
CSS: How To Learn Easily
shabab shihan
 
NEPA BlogCon 2013 - WordPress Customization & Security
NEPA BlogCon 2013 - WordPress Customization & SecurityNEPA BlogCon 2013 - WordPress Customization & Security
NEPA BlogCon 2013 - WordPress Customization & Security
Michelle Davies (Hryvnak)
 
Css week11 2020 2021 for g10 by eng.osama ghandour
Css week11 2020 2021 for g10 by eng.osama ghandourCss week11 2020 2021 for g10 by eng.osama ghandour
Css week11 2020 2021 for g10 by eng.osama ghandour
Osama Ghandour Geris
 
Ad

Recently uploaded (20)

Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make .pptx
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make   .pptxWebinar - Top 5 Backup Mistakes MSPs and Businesses Make   .pptx
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make .pptx
MSP360
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Connect and Protect: Networks and Network Security
Connect and Protect: Networks and Network SecurityConnect and Protect: Networks and Network Security
Connect and Protect: Networks and Network Security
VICTOR MAESTRE RAMIREZ
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
MINDCTI revenue release Quarter 1 2025 PR
MINDCTI revenue release Quarter 1 2025 PRMINDCTI revenue release Quarter 1 2025 PR
MINDCTI revenue release Quarter 1 2025 PR
MIND CTI
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Canadian book publishing: Insights from the latest salary survey - Tech Forum...
Canadian book publishing: Insights from the latest salary survey - Tech Forum...Canadian book publishing: Insights from the latest salary survey - Tech Forum...
Canadian book publishing: Insights from the latest salary survey - Tech Forum...
BookNet Canada
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make .pptx
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make   .pptxWebinar - Top 5 Backup Mistakes MSPs and Businesses Make   .pptx
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make .pptx
MSP360
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Connect and Protect: Networks and Network Security
Connect and Protect: Networks and Network SecurityConnect and Protect: Networks and Network Security
Connect and Protect: Networks and Network Security
VICTOR MAESTRE RAMIREZ
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
MINDCTI revenue release Quarter 1 2025 PR
MINDCTI revenue release Quarter 1 2025 PRMINDCTI revenue release Quarter 1 2025 PR
MINDCTI revenue release Quarter 1 2025 PR
MIND CTI
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Canadian book publishing: Insights from the latest salary survey - Tech Forum...
Canadian book publishing: Insights from the latest salary survey - Tech Forum...Canadian book publishing: Insights from the latest salary survey - Tech Forum...
Canadian book publishing: Insights from the latest salary survey - Tech Forum...
BookNet Canada
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 

TMW Code Club – Session 2 - CSS Basics

  • 1. TMW Code Club TMW Code Club Week 2: CSS – The fundamentals
  • 2. TMW Code Club Do you know more than this guy?
  • 4. TMW Code Club HTML, CSS, JavaScriptContent Styling Behaviour Text, images, video Colours, borders, backgrounds, shadows Click, touch, scroll, hover
  • 5. TMW Code Club Week 2 CSS – The basics • The cascade • Importance, specificity and source order • Classes and IDs • CSS properties and terminology
  • 7. TMW Code Club By combining importance, origin, specificity, and the source order of the style concerned, the CSS cascade assigns a weight to each declaration. This weight is used to determine exactly, and without conflict, which style declarations should be applied to a specific element: the declaration with the highest weight takes precedence. What is this cascade? http://reference.sitepoint.com/css/cascade 7
  • 8. TMW Code Club By combining importance, origin, specificity, and the source order of the style concerned, the CSS cascade assigns a weight to each declaration. This weight is used to determine exactly, and without conflict, which style declarations should be applied to a specific element: the declaration with the highest weight takes precedence. What is this cascade? http://reference.sitepoint.com/css/cascade 8
  • 10. TMW Code Club What happens here?
  • 11. TMW Code Club Let’s try it for real codepen.io/mrmartineau/pen/nfDcE
  • 12. TMW Code Club Selectors • Element • Classes • IDs • Complex selectors
  • 13. TMW Code Club Element selectors • Matches elements with the corresponding element type name • Quite general and not very specific.
  • 14. TMW Code Club What are classes and IDs? When there are more than one of a given element on the page, and you need to look different, you will need to use classes and IDs. <div></div> ! <div id=“foo”></div> ! <div class=“bar”></div> Element: ! ID: ! Class:
  • 15. TMW Code Club What are classes and IDs? • IDs are unique. Only one allowed per page. • Multiple classes can be used per page & elements can even have multiple classes <div></div> ! <div id=“foo”></div> ! <div class=“bar”></div> Element: ! ID: ! Class:
  • 16. TMW Code Club ID selectors Matches an element that has a specific id attribute value. Since id attributes must have unique values, an ID selector can never match more than one element in a document.
  • 17. TMW Code Club Class selectors Less specific than an ID because they are not unique
  • 18. TMW Code Club More complex selectors Siblings, Children and descendent selectors
  • 19. TMW Code Club Selector examples codepen.io/mrmartineau/pen/jgCvq
  • 20. TMW Code Club CSS Properties Basic Styling
  • 22. TMW Code Club color (or colour) The color property sets the text colour of an elements content, and it’s decorations (such as underlines, or line throughs). More info: https://developer.mozilla.org/en-US/docs/Web/CSS/color
  • 23. TMW Code Club color (or colour) Colours in CSS can be defined in a number of ways. To set our text colour to black, we could define it… ! …as a hex code = #000 = #000000 …an RGB value = rgb(0, 0, 0) …an hsl value = hsl(0%, 0%, 0%) …or using the reserved CSS keyword ‘black’ More info: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
  • 24. TMW Code Club color (or colour) You can also set colours for the following properties: ! background-color! color! border-color!
  • 25. TMW Code Club color example codepen.io/ashleynolan/pen/Blnkc
  • 27. TMW Code Club background The background property allows you to control the background of any element. More info: https://developer.mozilla.org/en-US/docs/Web/CSS/background
  • 28. TMW Code Club background Can be an image: background-image: url(‘myimage.png’);! ! or a color, as mentioned before: background-color: #fff; More info: https://developer.mozilla.org/en-US/docs/Web/CSS/background
  • 29. TMW Code Club background Some properties have a shortcut alternative, in which you can specify multiple properties at once. ! background-color: #fff;! background-image: url(‘myimage.png’);! becomes background: #fff url(‘myimage.png’); More info: https://developer.mozilla.org/en-US/docs/Web/CSS/background
  • 30. TMW Code Club background background also has other properties ! background-image! background-position! background-repeat! background-color More info: https://developer.mozilla.org/en-US/docs/Web/CSS/background
  • 31. TMW Code Club background example http://codepen.io/ashleynolan/pen/dxocr
  • 32. TMW Code Club text properties
  • 33. TMW Code Club text properties Text has a number of CSS properties that can be applied. More info: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/font-size
  • 34. TMW Code Club font-size text properties font-size can be defined in px (as well as a few other ways which we‘ll get to in a later lesson) ! font-size: 16px; More info: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/font-size
  • 35. TMW Code Club line-height text properties line-height can also be defined in px, but can also be unitless, which is relative to the font-size ! line-height: 16px;! or line-height: 1.5;! where the line-height is multiplied by the font-size More info: https://developer.mozilla.org/en-US/docs/Web/CSS/line-height
  • 36. TMW Code Club text decoration text properties Text can be given a text-decoration ! So for example, links (<a> tags) have the following by default: ! text-decoration: underline;! ! It takes the following values: underline, line-through or overline! More info: https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration
  • 37. TMW Code Club text shadow text properties Text can also be given a shadow ! text-shadow: 0 -2px #000; More info: https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow
  • 38. TMW Code Club text examples Text decoration: codepen.io/ashleynolan/pen/pxnCc ! Text shadow: codepen.io/ashleynolan/pen/zrLlv ! Text shadow example: codepen.io/juanbrujo/pen/yGpAK
  • 39. TMW Code Club Homework! Style up the earlier codepen example to have a custom styled title and paragraph text. Use any of the CSS properties we've seen today. ! http://codepen.io/ashleynolan/pen/Blnkc