SlideShare a Scribd company logo
Html and CSS 101 - hipages Group Friday talk
What is HTML?
0 HTML
0 “HyperText Markup Language”
0 Language for creating web pages
0 Composed of “tags”/elements
0 Should be structured, following a semantic flow

(understood by browser and developer)
Technical Jargon?!?
0 Tags (also known as elements) – has attributes, values
Semantic Elements vs Non-Semantic
0 Non semantic elements
(tells nothing about its content)

• <div>, <span> etc

0 Semantic elements

(clearly defines its content)
• <p>, <img> etc
• <table>, <form> etc
HTML Examples
0 HTML
0 Combination of “tags” which should have a semantic flow
0 Ordered, structured, hierarchical
HTML Examples
Code
<div class="media_block“ id=“wrapper”>
<img src="/images/128x128.gif" alt="pladceholder image" class="media” />
<div class="media_desc">
<p class="important pbn mbn">I am a 'Media Block' :)</p>
<p class="pan man">Lorem ipsum dolor sit amet...</p>
</div>
</div>

Output
What is CSS?
0 CSS
 “Cascading Style Sheets” (3 types)
• Inline
• Internal
• External
 Language to style and format of a document
 Combination of “rules” made of “declarations” and

“selectors”
Technical Jargon?!?
0 Rules
• Made up of Declarations and Selectors
0 Declaration
• Made up of Properties and Values
CSS Examples
0 CSS
• Combination of “rules”
• Structured and grouped by “selectors”
• Anything from color to font sizes to positioning
What is HTML and CSS?
CSS Syntax
0 Element
img {border: none;}
0 ID
#id_red {color: red;}
0 Class
.class_blue {color: blue;}
0 Pseudo
a:link {color: green;}
tr:first-child {background-color: grey}
0 Override
.class_pink {color: pink !important}
CSS Types
0 Inline
•
•
•
•
•

Styles declared on each HTML tag
Loaded on each page load
Bad practice – not encouraged! (Nightmare… NOOOOOO!!)
Not resuable
Extremely poor performance
CSS Types
0 Internal
• Styles declared on page
• Loaded on each page load – poor performance
• Considered bad practice… BUT… (no black and white?)
only if you have to… A/B Testing?
CSS Types
0 External
• Styles declared on separate file
• Best practice
• Cached by browser – faster performance
• Could be more than 1 file, later combined and minified
(compressed and optimised)
CSS: Different Sources and Order of !importance
1. User agent – the browser’s default stylesheet
2. User defined – user can define styles in their

browser
3. Author – CSS on the site visited
(inline, internal, external)

There is this override rule called… !important
4. Author !important
5. User !important
(A user might want a larger font or a different color, for
example)
What is CSS Specificity?
0 The beauty of CSS – “cascading”

0 Order, which rule takes priority?
• “Who would win in a fight?
• How it is calculated? (Rules of Specificity)

• Star Wars fan anyone?
http://www.stuffandnonsense.co.uk/archives/images/specificity
wars-05v2.jpg
CSS Specificity
0 !important is Superman – can beat anything – bad practice
0 Inline styles – bad practice

0 IDs
0 Location dependent
0 Class
0 When two selectors have the same specificity, the last one wins
0 Misconception: the order of class makes no difference
A little test… who

will win the fight?

http://adelaineho.public.hip/html_templates/presentation/specificity.html
Another test… who

will win?

http://adelaineho.public.hip/html_templates/presentation/specificity2.html
Coding for Cross Browser Compatibility
Coding for Cross Browser Compatibility
0 Famous IE6 Bugs
• Misbehaving Floats
• Double Margin on Floats
• Staircase Effect
• Centering Layout
Misbehaving Floats

Expected:

2 elements are floated with a
parent wrapper around it.
The Fix
0 Add overflow:hidden to parent

wrapper – works every time!
{overflow:hidden} is KING!!!

IE output:
Expected:

Double Margin on Floats
2 elements are floated with a
parent wrapper around it.
The Fix
0 Add overflow:hidden to parent

wrapper – works every time!
{overflow:hidden} is KING!!!

IE output:
Large Scale Websites
0 Want to reuse CSS as much as possible
• Avoid re-inventing the wheel

0 Performance is key
0 Consistency is hard to maintain
0 Specificity grows over time
0 Difficult to tell which rule takes precedence
Framework
0 Reusable elements and CSS (media blocks yaaaay!)
0 Think flexibility!
• Separate layout/positioning with stylistic styles
0 Multiple classes in the same tag/element is not a bad

thing
0 Avoid !important and location specific CSS
0 Should be easy to use

• new developers join the team – as Craig likes to put it…

“adzvinci code” - #adzfail!

0 WAR against designers and front-end developers…
Developer: Do you promise every time we have this button on
the site, it will be green with no border, grey text and bolded??

Designer: I promise!
Developer: Can you put your life on it, it won’t change?
Designer: Yes!
Developer: OK 

A few months later…
Designer: Here’s the wireframe…

Developer: Doh!
Overview of our Current Framework
Components:
0 960 grid
• positioning and layout
0 Fonts
• any fonts we wish to embed
0 Core
• our own positioning/layout classes
(margin/padding/widths/heights)

0 Base Skin
• stylistic elements which can be shared across all our apps
(HIP, NTP, PETs)
0 Application Skin
• stylistic elements specific to app (only HIP etc)
Pre-Framework Times

10034 lines
Current CSS Framework

833 lines
Html and CSS 101 - hipages Group Friday talk
We’ll Go More Technical…
0 DEBATE: Balance between reusable CSS and clean

HTML – still something I am trying to figure out?!?!
How many CSS classes in one element?
We’ll Go More Technical…
0 DEBATE: What are good practices and bad practices?
• IE Conditional statements?
• Progressive Enhancement v.s Pixel Perfect Layout?
• Location specific CSS
• Best Practice?
http://www.maxdesign.com.au/articles/the-myth-of-best-practice/

More Related Content

What's hot (20)

PDF
CSS Grid
eystein
 
PPTX
Design for Developers: Introduction to Bootstrap 3
John Bertucci
 
KEY
Webmonkey
isac Lagerblad
 
PDF
TMW Code Club Session 1
nolly00
 
PDF
Custom Post Types in the wild (WordCamp Sofia 2012)
Mario Peshev
 
PPTX
WEBD 162: Intro to CSS
palomateach
 
PPTX
Bug Prevention of SQL Injection
Surabaya Blackhat
 
PDF
Responsive Web Design with HTML5 and CSS3
Kannika Kong
 
PDF
Psd 2 Drupal
Nicolas Borda
 
PPTX
Introduction to Web Development - CSS
SadhanaParameswaran
 
PPT
Using a CSS Framework
eby
 
PDF
6 Steps to Make Your CSS Code More Maintainable
10Clouds
 
PPTX
Edy Dawson Notes on SF HTML5 Dev Conf
Edy Dawson
 
PDF
Steve Barman - CSS and WordPress
Anthony Montalbano
 
PPTX
YMC Season 4 - Day5
theymc
 
PPTX
Bootstrap: the full overview
Gill Cleeren
 
PDF
網頁程式設計
傳錡 蕭
 
PPTX
CSS introduction
CloudTech 
 
PPTX
CSS Learnup for Live Chat
Jacklyn Stachurski
 
CSS Grid
eystein
 
Design for Developers: Introduction to Bootstrap 3
John Bertucci
 
Webmonkey
isac Lagerblad
 
TMW Code Club Session 1
nolly00
 
Custom Post Types in the wild (WordCamp Sofia 2012)
Mario Peshev
 
WEBD 162: Intro to CSS
palomateach
 
Bug Prevention of SQL Injection
Surabaya Blackhat
 
Responsive Web Design with HTML5 and CSS3
Kannika Kong
 
Psd 2 Drupal
Nicolas Borda
 
Introduction to Web Development - CSS
SadhanaParameswaran
 
Using a CSS Framework
eby
 
6 Steps to Make Your CSS Code More Maintainable
10Clouds
 
Edy Dawson Notes on SF HTML5 Dev Conf
Edy Dawson
 
Steve Barman - CSS and WordPress
Anthony Montalbano
 
YMC Season 4 - Day5
theymc
 
Bootstrap: the full overview
Gill Cleeren
 
網頁程式設計
傳錡 蕭
 
CSS introduction
CloudTech 
 
CSS Learnup for Live Chat
Jacklyn Stachurski
 

Similar to Html and CSS 101 - hipages Group Friday talk (20)

PDF
CSS Interview Questions for Fresher and Experience
Hitesh Kumar
 
PPTX
Howcssworks 100207024009-phpapp01
Likitha47
 
PPT
3-CSS_essentials.ppt
datapro2
 
PPT
3-CSS_essentials.ppt
scet315
 
PPT
CSS Essentials for Website Development.ppt
unknownman23570
 
PPT
3-CSS_essentials_developers_begineers.ppt
mohamed abd elrazek
 
PPT
3-CSS_essentials introduction slides.ppt
Aasma13
 
PPT
3 css essentials
Anchu S
 
PPTX
basic programming language AND HTML CSS JAVApdf
elayelily
 
PDF
Evolution of CSS
Ecaterina Moraru (Valica)
 
PDF
Styling Your Web Pages with Cascading Style Sheets / EDU course / University ...
Patrick Lauke
 
PPT
Web design-workflow
Peter Kaizer
 
PPTX
CSS101 - Concept Fundamentals for non UI Developers
Darren Gideon
 
PDF
Professional Css
Subramanyan Murali
 
PPTX
Cascading Style Sheets - CSS
Sun Technlogies
 
PPTX
Beginners css tutorial for web designers
Singsys Pte Ltd
 
PPTX
Module 2 CSS . cascading style sheet and its uses
BKReddy3
 
PPTX
CSS Basics
Nitin Bhide
 
PDF
The CSS Handbook
jackchenvlo
 
CSS Interview Questions for Fresher and Experience
Hitesh Kumar
 
Howcssworks 100207024009-phpapp01
Likitha47
 
3-CSS_essentials.ppt
datapro2
 
3-CSS_essentials.ppt
scet315
 
CSS Essentials for Website Development.ppt
unknownman23570
 
3-CSS_essentials_developers_begineers.ppt
mohamed abd elrazek
 
3-CSS_essentials introduction slides.ppt
Aasma13
 
3 css essentials
Anchu S
 
basic programming language AND HTML CSS JAVApdf
elayelily
 
Evolution of CSS
Ecaterina Moraru (Valica)
 
Styling Your Web Pages with Cascading Style Sheets / EDU course / University ...
Patrick Lauke
 
Web design-workflow
Peter Kaizer
 
CSS101 - Concept Fundamentals for non UI Developers
Darren Gideon
 
Professional Css
Subramanyan Murali
 
Cascading Style Sheets - CSS
Sun Technlogies
 
Beginners css tutorial for web designers
Singsys Pte Ltd
 
Module 2 CSS . cascading style sheet and its uses
BKReddy3
 
CSS Basics
Nitin Bhide
 
The CSS Handbook
jackchenvlo
 
Ad

Recently uploaded (20)

PDF
WEEK3-Literary-Gennnnnnnnnnnnnnnnnres.pdf
MaybelynVergara
 
PPTX
Bldg Mtc 8 Maintance documentation and audits - 25 (2).pptx
MwanamomoMpamba
 
DOCX
Redefining Master Plans for creating sustainable cities-Jharkhand Conference...
JIT KUMAR GUPTA
 
PPTX
7psofmarketingandbranding-250114091831-cba08a7c (1).pptx
jamescarllfelomino6
 
PDF
placemaking 10 principles bY Berkley group
Radhika525487
 
PDF
Ecowood.pdf | Tranquil Global Acoustics India
tranquil01
 
PDF
AI Intervention in Design & Content Creation
YellowSlice1
 
PDF
SS27 Men's Fashion Trend Book Peclers Paris
Peclers Paris
 
PDF
Plastic Foam as eco-friendly product in interiors
Disha Agrawal
 
PPTX
hall ppt 1 it for basic tamolet .pptx
ashishbehera64
 
PDF
cs603 ppts .pdf 222222222222222222222222
RabiaNazneen1
 
PPTX
Exploring Types of Rocks Educational Presentation rock forming james harold r...
jamescarllfelomino6
 
PPTX
Elevating Elegance: Lobby Design Ideas by Germany’s Top Building Rendering Se...
Yantram Animation Studio Corporation
 
PPTX
办理学历认证UHI在读证明信英国赫特福德郡大学毕业证范本,UHI成绩单修改
Taqyea
 
PDF
Presentation - Interior Design Concepts (2).pdf
vrindagrawal456
 
PPTX
AI_Road_Safety_Project.pptx for class 10
prem001ni
 
PDF
respiratory-and-circulatory-system-pdf-hand-outs.pdf
galocharles28
 
PDF
EY-emeia-fso-assurance-viewpoint-technology (1).pdf
INKPPT
 
PDF
tdtr.pdfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
JuanCParedes
 
PPTX
Chapter 2-3.pptxnsnsnsnsnsjsjsjsjejeusuejsjsj
hibaaqabdirisaaq331
 
WEEK3-Literary-Gennnnnnnnnnnnnnnnnres.pdf
MaybelynVergara
 
Bldg Mtc 8 Maintance documentation and audits - 25 (2).pptx
MwanamomoMpamba
 
Redefining Master Plans for creating sustainable cities-Jharkhand Conference...
JIT KUMAR GUPTA
 
7psofmarketingandbranding-250114091831-cba08a7c (1).pptx
jamescarllfelomino6
 
placemaking 10 principles bY Berkley group
Radhika525487
 
Ecowood.pdf | Tranquil Global Acoustics India
tranquil01
 
AI Intervention in Design & Content Creation
YellowSlice1
 
SS27 Men's Fashion Trend Book Peclers Paris
Peclers Paris
 
Plastic Foam as eco-friendly product in interiors
Disha Agrawal
 
hall ppt 1 it for basic tamolet .pptx
ashishbehera64
 
cs603 ppts .pdf 222222222222222222222222
RabiaNazneen1
 
Exploring Types of Rocks Educational Presentation rock forming james harold r...
jamescarllfelomino6
 
Elevating Elegance: Lobby Design Ideas by Germany’s Top Building Rendering Se...
Yantram Animation Studio Corporation
 
办理学历认证UHI在读证明信英国赫特福德郡大学毕业证范本,UHI成绩单修改
Taqyea
 
Presentation - Interior Design Concepts (2).pdf
vrindagrawal456
 
AI_Road_Safety_Project.pptx for class 10
prem001ni
 
respiratory-and-circulatory-system-pdf-hand-outs.pdf
galocharles28
 
EY-emeia-fso-assurance-viewpoint-technology (1).pdf
INKPPT
 
tdtr.pdfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
JuanCParedes
 
Chapter 2-3.pptxnsnsnsnsnsjsjsjsjejeusuejsjsj
hibaaqabdirisaaq331
 
Ad

Html and CSS 101 - hipages Group Friday talk

  • 2. What is HTML? 0 HTML 0 “HyperText Markup Language” 0 Language for creating web pages 0 Composed of “tags”/elements 0 Should be structured, following a semantic flow (understood by browser and developer)
  • 3. Technical Jargon?!? 0 Tags (also known as elements) – has attributes, values
  • 4. Semantic Elements vs Non-Semantic 0 Non semantic elements (tells nothing about its content) • <div>, <span> etc 0 Semantic elements (clearly defines its content) • <p>, <img> etc • <table>, <form> etc
  • 5. HTML Examples 0 HTML 0 Combination of “tags” which should have a semantic flow 0 Ordered, structured, hierarchical
  • 6. HTML Examples Code <div class="media_block“ id=“wrapper”> <img src="/images/128x128.gif" alt="pladceholder image" class="media” /> <div class="media_desc"> <p class="important pbn mbn">I am a 'Media Block' :)</p> <p class="pan man">Lorem ipsum dolor sit amet...</p> </div> </div> Output
  • 7. What is CSS? 0 CSS  “Cascading Style Sheets” (3 types) • Inline • Internal • External  Language to style and format of a document  Combination of “rules” made of “declarations” and “selectors”
  • 8. Technical Jargon?!? 0 Rules • Made up of Declarations and Selectors 0 Declaration • Made up of Properties and Values
  • 9. CSS Examples 0 CSS • Combination of “rules” • Structured and grouped by “selectors” • Anything from color to font sizes to positioning
  • 10. What is HTML and CSS?
  • 11. CSS Syntax 0 Element img {border: none;} 0 ID #id_red {color: red;} 0 Class .class_blue {color: blue;} 0 Pseudo a:link {color: green;} tr:first-child {background-color: grey} 0 Override .class_pink {color: pink !important}
  • 12. CSS Types 0 Inline • • • • • Styles declared on each HTML tag Loaded on each page load Bad practice – not encouraged! (Nightmare… NOOOOOO!!) Not resuable Extremely poor performance
  • 13. CSS Types 0 Internal • Styles declared on page • Loaded on each page load – poor performance • Considered bad practice… BUT… (no black and white?) only if you have to… A/B Testing?
  • 14. CSS Types 0 External • Styles declared on separate file • Best practice • Cached by browser – faster performance • Could be more than 1 file, later combined and minified (compressed and optimised)
  • 15. CSS: Different Sources and Order of !importance 1. User agent – the browser’s default stylesheet 2. User defined – user can define styles in their browser 3. Author – CSS on the site visited (inline, internal, external) There is this override rule called… !important 4. Author !important 5. User !important (A user might want a larger font or a different color, for example)
  • 16. What is CSS Specificity? 0 The beauty of CSS – “cascading” 0 Order, which rule takes priority? • “Who would win in a fight? • How it is calculated? (Rules of Specificity) • Star Wars fan anyone? http://www.stuffandnonsense.co.uk/archives/images/specificity wars-05v2.jpg
  • 17. CSS Specificity 0 !important is Superman – can beat anything – bad practice 0 Inline styles – bad practice 0 IDs 0 Location dependent 0 Class 0 When two selectors have the same specificity, the last one wins 0 Misconception: the order of class makes no difference
  • 18. A little test… who will win the fight? http://adelaineho.public.hip/html_templates/presentation/specificity.html
  • 19. Another test… who will win? http://adelaineho.public.hip/html_templates/presentation/specificity2.html
  • 20. Coding for Cross Browser Compatibility
  • 21. Coding for Cross Browser Compatibility 0 Famous IE6 Bugs • Misbehaving Floats • Double Margin on Floats • Staircase Effect • Centering Layout
  • 22. Misbehaving Floats Expected: 2 elements are floated with a parent wrapper around it. The Fix 0 Add overflow:hidden to parent wrapper – works every time! {overflow:hidden} is KING!!! IE output:
  • 23. Expected: Double Margin on Floats 2 elements are floated with a parent wrapper around it. The Fix 0 Add overflow:hidden to parent wrapper – works every time! {overflow:hidden} is KING!!! IE output:
  • 24. Large Scale Websites 0 Want to reuse CSS as much as possible • Avoid re-inventing the wheel 0 Performance is key 0 Consistency is hard to maintain 0 Specificity grows over time 0 Difficult to tell which rule takes precedence
  • 25. Framework 0 Reusable elements and CSS (media blocks yaaaay!) 0 Think flexibility! • Separate layout/positioning with stylistic styles 0 Multiple classes in the same tag/element is not a bad thing 0 Avoid !important and location specific CSS 0 Should be easy to use • new developers join the team – as Craig likes to put it… “adzvinci code” - #adzfail! 0 WAR against designers and front-end developers…
  • 26. Developer: Do you promise every time we have this button on the site, it will be green with no border, grey text and bolded?? Designer: I promise! Developer: Can you put your life on it, it won’t change? Designer: Yes! Developer: OK  A few months later… Designer: Here’s the wireframe… Developer: Doh!
  • 27. Overview of our Current Framework Components: 0 960 grid • positioning and layout 0 Fonts • any fonts we wish to embed 0 Core • our own positioning/layout classes (margin/padding/widths/heights) 0 Base Skin • stylistic elements which can be shared across all our apps (HIP, NTP, PETs) 0 Application Skin • stylistic elements specific to app (only HIP etc)
  • 31. We’ll Go More Technical… 0 DEBATE: Balance between reusable CSS and clean HTML – still something I am trying to figure out?!?! How many CSS classes in one element?
  • 32. We’ll Go More Technical… 0 DEBATE: What are good practices and bad practices? • IE Conditional statements? • Progressive Enhancement v.s Pixel Perfect Layout? • Location specific CSS • Best Practice? http://www.maxdesign.com.au/articles/the-myth-of-best-practice/