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

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

What's hot (20)

CSS Grid
CSS GridCSS Grid
CSS Grid
 
Design for Developers: Introduction to Bootstrap 3
Design for Developers: Introduction to Bootstrap 3Design for Developers: Introduction to Bootstrap 3
Design for Developers: Introduction to Bootstrap 3
 
Webmonkey
WebmonkeyWebmonkey
Webmonkey
 
TMW Code Club Session 1
TMW Code Club Session 1TMW Code Club Session 1
TMW Code Club Session 1
 
Custom Post Types in the wild (WordCamp Sofia 2012)
Custom Post Types in the wild (WordCamp Sofia 2012)Custom Post Types in the wild (WordCamp Sofia 2012)
Custom Post Types in the wild (WordCamp Sofia 2012)
 
WEBD 162: Intro to CSS
WEBD 162: Intro to CSSWEBD 162: Intro to CSS
WEBD 162: Intro to CSS
 
Bug Prevention of SQL Injection
Bug Prevention of SQL InjectionBug Prevention of SQL Injection
Bug Prevention of SQL Injection
 
Css
CssCss
Css
 
Responsive Web Design with HTML5 and CSS3
Responsive Web Design with HTML5 and CSS3Responsive Web Design with HTML5 and CSS3
Responsive Web Design with HTML5 and CSS3
 
Psd 2 Drupal
Psd 2 DrupalPsd 2 Drupal
Psd 2 Drupal
 
Introduction to Web Development - CSS
Introduction to Web Development - CSSIntroduction to Web Development - CSS
Introduction to Web Development - CSS
 
Using a CSS Framework
Using a CSS FrameworkUsing a CSS Framework
Using a CSS Framework
 
6 Steps to Make Your CSS Code More Maintainable
6 Steps to Make Your CSS Code More Maintainable6 Steps to Make Your CSS Code More Maintainable
6 Steps to Make Your CSS Code More Maintainable
 
Edy Dawson Notes on SF HTML5 Dev Conf
Edy Dawson Notes on SF HTML5 Dev ConfEdy Dawson Notes on SF HTML5 Dev Conf
Edy Dawson Notes on SF HTML5 Dev Conf
 
Steve Barman - CSS and WordPress
Steve Barman - CSS and WordPressSteve Barman - CSS and WordPress
Steve Barman - CSS and WordPress
 
YMC Season 4 - Day5
YMC Season 4 - Day5YMC Season 4 - Day5
YMC Season 4 - Day5
 
Bootstrap: the full overview
Bootstrap: the full overviewBootstrap: the full overview
Bootstrap: the full overview
 
網頁程式設計
網頁程式設計網頁程式設計
網頁程式設計
 
CSS introduction
CSS introductionCSS introduction
CSS introduction
 
CSS Learnup for Live Chat
CSS Learnup for Live ChatCSS Learnup for Live Chat
CSS Learnup for Live Chat
 

Similar to Html and CSS 101 - hipages Group Friday talk

Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflow
Peter Kaizer
 
Cascading Style Sheets - CSS
Cascading Style Sheets - CSSCascading Style Sheets - CSS
Cascading Style Sheets - CSS
Sun Technlogies
 
Advanced CSS Troubleshooting
Advanced CSS TroubleshootingAdvanced CSS Troubleshooting
Advanced CSS Troubleshooting
Denise Jacobs
 
Highly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSSHighly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSS
Zoe Gillenwater
 
Simply Responsive CSS3
Simply Responsive CSS3Simply Responsive CSS3
Simply Responsive CSS3
Denise Jacobs
 
CSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondCSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to Respond
Denise Jacobs
 
Slow kinda sucks
Slow kinda sucksSlow kinda sucks
Slow kinda sucks
Tim Wright
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Erin M. Kidwell
 
Howcssworks 100207024009-phpapp01
Howcssworks 100207024009-phpapp01Howcssworks 100207024009-phpapp01
Howcssworks 100207024009-phpapp01
Likitha47
 
Theme Development: From an idea to getting approved to wordpress.org
Theme Development: From an idea to getting approved to wordpress.orgTheme Development: From an idea to getting approved to wordpress.org
Theme Development: From an idea to getting approved to wordpress.org
ThemeHorse
 
Thinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSSThinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSS
TJ Stalcup
 
CSS3: Ripe and Ready
CSS3: Ripe and ReadyCSS3: Ripe and Ready
CSS3: Ripe and Ready
Denise Jacobs
 
Css week10 2019 2020 for g10 by eng.osama ghandour
Css week10 2019 2020 for g10 by eng.osama ghandourCss week10 2019 2020 for g10 by eng.osama ghandour
Css week10 2019 2020 for g10 by eng.osama ghandour
Osama Ghandour Geris
 
Structuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSStructuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSS
Sanjoy Kr. Paul
 
Pertemuan 7
Pertemuan 7Pertemuan 7
Pertemuan 7
beiharira
 
Html:css crash course (4:5)
Html:css crash course (4:5)Html:css crash course (4:5)
Html:css crash course (4:5)
Thinkful
 
Sitting in the Driver's Seat
Sitting in the Driver's SeatSitting in the Driver's Seat
Sitting in the Driver's Seat
Jack Moffett
 
Be nice to your designers
Be nice to your designersBe nice to your designers
Be nice to your designers
Pai-Cheng Tao
 
Blackboard DevCon 2011 - Performance Considerations for Custom Theme Development
Blackboard DevCon 2011 - Performance Considerations for Custom Theme DevelopmentBlackboard DevCon 2011 - Performance Considerations for Custom Theme Development
Blackboard DevCon 2011 - Performance Considerations for Custom Theme Development
Noriaki Tatsumi
 
CSS Overview
CSS OverviewCSS Overview
CSS Overview
Doncho Minkov
 

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

Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflow
 
Cascading Style Sheets - CSS
Cascading Style Sheets - CSSCascading Style Sheets - CSS
Cascading Style Sheets - CSS
 
Advanced CSS Troubleshooting
Advanced CSS TroubleshootingAdvanced CSS Troubleshooting
Advanced CSS Troubleshooting
 
Highly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSSHighly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSS
 
Simply Responsive CSS3
Simply Responsive CSS3Simply Responsive CSS3
Simply Responsive CSS3
 
CSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondCSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to Respond
 
Slow kinda sucks
Slow kinda sucksSlow kinda sucks
Slow kinda sucks
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
 
Howcssworks 100207024009-phpapp01
Howcssworks 100207024009-phpapp01Howcssworks 100207024009-phpapp01
Howcssworks 100207024009-phpapp01
 
Theme Development: From an idea to getting approved to wordpress.org
Theme Development: From an idea to getting approved to wordpress.orgTheme Development: From an idea to getting approved to wordpress.org
Theme Development: From an idea to getting approved to wordpress.org
 
Thinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSSThinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSS
 
CSS3: Ripe and Ready
CSS3: Ripe and ReadyCSS3: Ripe and Ready
CSS3: Ripe and Ready
 
Css week10 2019 2020 for g10 by eng.osama ghandour
Css week10 2019 2020 for g10 by eng.osama ghandourCss week10 2019 2020 for g10 by eng.osama ghandour
Css week10 2019 2020 for g10 by eng.osama ghandour
 
Structuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSStructuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSS
 
Pertemuan 7
Pertemuan 7Pertemuan 7
Pertemuan 7
 
Html:css crash course (4:5)
Html:css crash course (4:5)Html:css crash course (4:5)
Html:css crash course (4:5)
 
Sitting in the Driver's Seat
Sitting in the Driver's SeatSitting in the Driver's Seat
Sitting in the Driver's Seat
 
Be nice to your designers
Be nice to your designersBe nice to your designers
Be nice to your designers
 
Blackboard DevCon 2011 - Performance Considerations for Custom Theme Development
Blackboard DevCon 2011 - Performance Considerations for Custom Theme DevelopmentBlackboard DevCon 2011 - Performance Considerations for Custom Theme Development
Blackboard DevCon 2011 - Performance Considerations for Custom Theme Development
 
CSS Overview
CSS OverviewCSS Overview
CSS Overview
 

Recently uploaded

PDF SubmissionDigital Marketing Institute in Noida
PDF SubmissionDigital Marketing Institute in NoidaPDF SubmissionDigital Marketing Institute in Noida
PDF SubmissionDigital Marketing Institute in Noida
PoojaSaini954651
 
ARENA - Young adults in the workplace (Knight Moves).pdf
ARENA - Young adults in the workplace (Knight Moves).pdfARENA - Young adults in the workplace (Knight Moves).pdf
ARENA - Young adults in the workplace (Knight Moves).pdf
Knight Moves
 
Divertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8djDivertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8dj
lunaemel03
 
Heuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdfHeuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdf
Jaime Brown
 
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
7sd8fier
 
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdfSECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
eloprejohn333
 
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANEEASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
Febless Hernane
 
Mohannad Abdullah portfolio _ V2 _22-24
Mohannad Abdullah  portfolio _ V2 _22-24Mohannad Abdullah  portfolio _ V2 _22-24
Mohannad Abdullah portfolio _ V2 _22-24
M. A. Architect
 
一比一原版(毕业证)长崎大学毕业证成绩单如何办理
一比一原版(毕业证)长崎大学毕业证成绩单如何办理一比一原版(毕业证)长崎大学毕业证成绩单如何办理
一比一原版(毕业证)长崎大学毕业证成绩单如何办理
taqyed
 
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdfAHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
talaatahm
 
20 slides of research movie and artists .pdf
20 slides of research movie and artists .pdf20 slides of research movie and artists .pdf
20 slides of research movie and artists .pdf
ameli25062005
 
UNIT IV-VISUAL STYLE AND MOBILE INTERFACES.pptx
UNIT IV-VISUAL STYLE AND MOBILE INTERFACES.pptxUNIT IV-VISUAL STYLE AND MOBILE INTERFACES.pptx
UNIT IV-VISUAL STYLE AND MOBILE INTERFACES.pptx
GOWSIKRAJA PALANISAMY
 
原版定做(penn毕业证书)美国宾夕法尼亚大学毕业证文凭学历证书原版一模一样
原版定做(penn毕业证书)美国宾夕法尼亚大学毕业证文凭学历证书原版一模一样原版定做(penn毕业证书)美国宾夕法尼亚大学毕业证文凭学历证书原版一模一样
原版定做(penn毕业证书)美国宾夕法尼亚大学毕业证文凭学历证书原版一模一样
gpffo76j
 
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
kecekev
 
一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理
一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理
一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理
7sd8fier
 
Impact of Fonts: in Web and Apps Design
Impact of Fonts:  in Web and Apps DesignImpact of Fonts:  in Web and Apps Design
Impact of Fonts: in Web and Apps Design
contactproperweb2014
 
Design Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinkingDesign Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinking
cy0krjxt
 
Maximize Your Content with Beautiful Assets : Content & Asset for Landing Page
Maximize Your Content with Beautiful Assets : Content & Asset for Landing Page Maximize Your Content with Beautiful Assets : Content & Asset for Landing Page
Maximize Your Content with Beautiful Assets : Content & Asset for Landing Page
pmgdscunsri
 
UNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptx
UNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptxUNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptx
UNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptx
GOWSIKRAJA PALANISAMY
 
Connect Conference 2022: Passive House - Economic and Environmental Solution...
Connect Conference 2022: Passive House -  Economic and Environmental Solution...Connect Conference 2022: Passive House -  Economic and Environmental Solution...
Connect Conference 2022: Passive House - Economic and Environmental Solution...
TE Studio
 

Recently uploaded (20)

PDF SubmissionDigital Marketing Institute in Noida
PDF SubmissionDigital Marketing Institute in NoidaPDF SubmissionDigital Marketing Institute in Noida
PDF SubmissionDigital Marketing Institute in Noida
 
ARENA - Young adults in the workplace (Knight Moves).pdf
ARENA - Young adults in the workplace (Knight Moves).pdfARENA - Young adults in the workplace (Knight Moves).pdf
ARENA - Young adults in the workplace (Knight Moves).pdf
 
Divertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8djDivertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8dj
 
Heuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdfHeuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdf
 
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
 
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdfSECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
 
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANEEASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
 
Mohannad Abdullah portfolio _ V2 _22-24
Mohannad Abdullah  portfolio _ V2 _22-24Mohannad Abdullah  portfolio _ V2 _22-24
Mohannad Abdullah portfolio _ V2 _22-24
 
一比一原版(毕业证)长崎大学毕业证成绩单如何办理
一比一原版(毕业证)长崎大学毕业证成绩单如何办理一比一原版(毕业证)长崎大学毕业证成绩单如何办理
一比一原版(毕业证)长崎大学毕业证成绩单如何办理
 
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdfAHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
 
20 slides of research movie and artists .pdf
20 slides of research movie and artists .pdf20 slides of research movie and artists .pdf
20 slides of research movie and artists .pdf
 
UNIT IV-VISUAL STYLE AND MOBILE INTERFACES.pptx
UNIT IV-VISUAL STYLE AND MOBILE INTERFACES.pptxUNIT IV-VISUAL STYLE AND MOBILE INTERFACES.pptx
UNIT IV-VISUAL STYLE AND MOBILE INTERFACES.pptx
 
原版定做(penn毕业证书)美国宾夕法尼亚大学毕业证文凭学历证书原版一模一样
原版定做(penn毕业证书)美国宾夕法尼亚大学毕业证文凭学历证书原版一模一样原版定做(penn毕业证书)美国宾夕法尼亚大学毕业证文凭学历证书原版一模一样
原版定做(penn毕业证书)美国宾夕法尼亚大学毕业证文凭学历证书原版一模一样
 
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
 
一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理
一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理
一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理
 
Impact of Fonts: in Web and Apps Design
Impact of Fonts:  in Web and Apps DesignImpact of Fonts:  in Web and Apps Design
Impact of Fonts: in Web and Apps Design
 
Design Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinkingDesign Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinking
 
Maximize Your Content with Beautiful Assets : Content & Asset for Landing Page
Maximize Your Content with Beautiful Assets : Content & Asset for Landing Page Maximize Your Content with Beautiful Assets : Content & Asset for Landing Page
Maximize Your Content with Beautiful Assets : Content & Asset for Landing Page
 
UNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptx
UNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptxUNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptx
UNIT V ACTIONS AND COMMANDS, FORMS AND CONTROLS.pptx
 
Connect Conference 2022: Passive House - Economic and Environmental Solution...
Connect Conference 2022: Passive House -  Economic and Environmental Solution...Connect Conference 2022: Passive House -  Economic and Environmental Solution...
Connect Conference 2022: Passive House - Economic and Environmental Solution...
 

Html and CSS 101 - hipages Group Friday talk

  • 1.
  • 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)
  • 30.
  • 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/