SlideShare a Scribd company logo
1 of 25
Download to read offline
Designing Your Next
Generation Web Pages with
CSS3
Gil Fink
CEO, sparXys
@gilfink, http://www.gilfink.net
Box of Doom Story
• How hard it is to create a box with rounded
corners?
Once Upon a Time…
• Creating rounded corners involved:
o Constructing the box with images and CSS border property
• Left corner image
• Right corner image
• Usage of border property /
Usage of a third border line
image
o Using a lot of CSS manipulations
CSS3 to the Rescue
border-radius property
Designing Your Next
Generation Web Pages with
CSS3
Gil Fink
CEO, sparXys
@gilfink, http://www.gilfink.net
Agenda
• CSS3: Recap
• Transitions, Transformations and Animation
• Responsive Design
• Q&A
• Summary
CSS3 in a Nutshell
• CSS: Cascading Style Sheets
o Describe the presentation semantics of HTML web pages
o Helps separate a document’s content from its layout and style
• Work on CSS3 began after CSS2 entered the
recommendation stage in 1999
• CSS3 is divided into modules
o Each module add new capabilities or extend features defined in CSS2
What’s new in CSS3?
• Transitions
• Transformations
• Animations
• New layout options
• Extended existing properties:
o Background
o Border
• And more
Transitions
• CSS3 support transitions
• Use the transition property and element events to
apply transitions
div
{
width: 50px;
height: 50px;
transition: width 2s; /* width change will apply a 2 second transition */
}
div:hover { /* hover will trigger the transition */
width: 150px;
}
Transformations
• CSS3 supports two and three dimensional element
transformations
o Use the transform property with transformation function
• You can apply transformations such as
o Translate
o Scale
o Rotate
o And more
#element
{
transform: rotate(30deg);
}
Animation
• CSS3 enables simple animations
• Use the @keyframes rule and animation property
@keyframes myAnim
{
0% { right: 0px; }
25% { right: 25px; background: blue; }
75% { right: 75px; background: red; }
100% { right: 100px; }
}
div
{
animation: myAnim 5s linear 5s infinite alternate ;
}
DEMO
Transitions, transformations and animations
http://desandro.github.io/3dtransforms/exampl
es/carousel-02-dynamic.html
http://desandro.github.io/3dtransforms/exampl
es/cube-02-show-sides.html
Responsive Design
• Optimization approach for UX view over a range of
devices
o Mobile, desktop, TV, Tablet and etc.
o UI depends on the device and its specifics (resolution, DPI and more)
Ways to Create a
Responsive Design
• Flexible layouts
o Flexbox
o Multi columns
o Grid layout
o Other CSS options
• Media queries
• And more
Flexible Layouts
• Flexible layouts uses proportional sizes:
• How can we do that with CSS3?
Sub
nav
content aside
Margins:2%
55%15% 20%
Multi Columns
• Arrange content in columns like in newspapers
• Content flows from one column to another
div
{
width: 200px;
column-width: 60px;
column-count: 3;
column-gap: 2em;
}
Flexible Box
• Position boxed elements inside a container element
• Controls how boxed elements relate to one another
o Flow direction, order and alignment
o Box sizes in response to container size
.container {
display: flexbox;
flex-direction: row;
border: 1px solid black;
width: 400px;
padding: 10px;
}
DEMO
Multi Columns and Flexbox
Media Queries
• Detect media features and respond accordingly
• Change the presentation of the content in response
to media changes
• Consist of a type and zero or more expressions
o Types can be screen, projection and resolution
o Expressions are the checks that will evaluated
Coding Media Queries
• If a media query expression is evaluated to true, the
styles in the query block are applied
• Rule of thumb - put media queries at the end of the
CSS file
.someDiv { width: 250px; height: 250px; }
@media only screen and (max-width: 1024px) {
.someDiv { width: 150px; height: 200px; }
}
@media only screen and (max-width: 800px) {
.someDiv { width: 120px; height: 180px; }
}
@media only screen and (max-width: 320px) {
.someDiv { width: 80px; height: 120px; }
}
DEMO
Media Queries
Questions?
Summary
• CSS3 changes the way we can design web pages:
o More layout and style options
o Options to replace JavaScript animation, transitions and transformations
• Make use of CSS3 today!
Thank You!

More Related Content

Viewers also liked

Viewers also liked (8)

End-to-End SPA Development using TypeScript
End-to-End SPA Development using TypeScriptEnd-to-End SPA Development using TypeScript
End-to-End SPA Development using TypeScript
 
Building Scalable JavaScript Apps
Building Scalable JavaScript AppsBuilding Scalable JavaScript Apps
Building Scalable JavaScript Apps
 
Creating Data Driven HTML5 Applications
Creating Data Driven HTML5 ApplicationsCreating Data Driven HTML5 Applications
Creating Data Driven HTML5 Applications
 
Single Page Apps
Single Page AppsSingle Page Apps
Single Page Apps
 
The Characteristics of a Successful SPA
The Characteristics of a Successful SPAThe Characteristics of a Successful SPA
The Characteristics of a Successful SPA
 
Getting Started with the TypeScript Language
Getting Started with the TypeScript LanguageGetting Started with the TypeScript Language
Getting Started with the TypeScript Language
 
JavaScript Frameworks and Java EE – A Great Match
JavaScript Frameworks and Java EE – A Great MatchJavaScript Frameworks and Java EE – A Great Match
JavaScript Frameworks and Java EE – A Great Match
 
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on DockerRunning High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
 

Similar to Designing Your Next Generation Web Pages with CSS3

Interactive Graphics
Interactive GraphicsInteractive Graphics
Interactive Graphics
Blazing Cloud
 

Similar to Designing Your Next Generation Web Pages with CSS3 (20)

MTA managing the graphical interface by using css
MTA managing the graphical interface by using cssMTA managing the graphical interface by using css
MTA managing the graphical interface by using css
 
Html5 more than just html5 v final
Html5  more than just html5 v finalHtml5  more than just html5 v final
Html5 more than just html5 v final
 
CSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondCSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to Respond
 
Iagc2
Iagc2Iagc2
Iagc2
 
Web development basics (Part-2)
Web development basics (Part-2)Web development basics (Part-2)
Web development basics (Part-2)
 
Rich and Beautiful: Making Attractive Apps in HTML5 [Wpg 2013]
Rich and Beautiful: Making Attractive Apps in HTML5 [Wpg 2013]Rich and Beautiful: Making Attractive Apps in HTML5 [Wpg 2013]
Rich and Beautiful: Making Attractive Apps in HTML5 [Wpg 2013]
 
CSS and CSS3
CSS and CSS3CSS and CSS3
CSS and CSS3
 
The New CSS Layout - Dutch PHP Conference
The New CSS Layout - Dutch PHP ConferenceThe New CSS Layout - Dutch PHP Conference
The New CSS Layout - Dutch PHP Conference
 
Intro to CSS3
Intro to CSS3Intro to CSS3
Intro to CSS3
 
Css3
Css3Css3
Css3
 
CSS3: Simply Responsive
CSS3: Simply ResponsiveCSS3: Simply Responsive
CSS3: Simply Responsive
 
Comparing XAML and HTML: FIGHT!
Comparing XAML and HTML: FIGHT!Comparing XAML and HTML: FIGHT!
Comparing XAML and HTML: FIGHT!
 
Interactive Graphics
Interactive GraphicsInteractive Graphics
Interactive Graphics
 
Web technologies-course 04.pptx
Web technologies-course 04.pptxWeb technologies-course 04.pptx
Web technologies-course 04.pptx
 
CSS3: Are you experienced?
CSS3: Are you experienced?CSS3: Are you experienced?
CSS3: Are you experienced?
 
Css3
Css3Css3
Css3
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
The web standards gentleman: a matter of (evolving) standards)
The web standards gentleman: a matter of (evolving) standards)The web standards gentleman: a matter of (evolving) standards)
The web standards gentleman: a matter of (evolving) standards)
 
Responsive Web Design (April 18th, Los Angeles)
Responsive Web Design (April 18th, Los Angeles)Responsive Web Design (April 18th, Los Angeles)
Responsive Web Design (April 18th, Los Angeles)
 
Css3
Css3Css3
Css3
 

More from Gil Fink

More from Gil Fink (20)

Becoming a Tech Speaker
Becoming a Tech SpeakerBecoming a Tech Speaker
Becoming a Tech Speaker
 
Web animation on steroids web animation api
Web animation on steroids web animation api Web animation on steroids web animation api
Web animation on steroids web animation api
 
The Time for Vanilla Web Components has Arrived
The Time for Vanilla Web Components has ArrivedThe Time for Vanilla Web Components has Arrived
The Time for Vanilla Web Components has Arrived
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
 
Stencil: The Time for Vanilla Web Components has Arrived
Stencil: The Time for Vanilla Web Components has ArrivedStencil: The Time for Vanilla Web Components has Arrived
Stencil: The Time for Vanilla Web Components has Arrived
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
 
Being a tech speaker
Being a tech speakerBeing a tech speaker
Being a tech speaker
 
Working with Data in Service Workers
Working with Data in Service WorkersWorking with Data in Service Workers
Working with Data in Service Workers
 
Demystifying Angular Animations
Demystifying Angular AnimationsDemystifying Angular Animations
Demystifying Angular Animations
 
Redux data flow with angular
Redux data flow with angularRedux data flow with angular
Redux data flow with angular
 
Redux data flow with angular
Redux data flow with angularRedux data flow with angular
Redux data flow with angular
 
Who's afraid of front end databases?
Who's afraid of front end databases?Who's afraid of front end databases?
Who's afraid of front end databases?
 
One language to rule them all type script
One language to rule them all type scriptOne language to rule them all type script
One language to rule them all type script
 
End to-end apps with type script
End to-end apps with type scriptEnd to-end apps with type script
End to-end apps with type script
 
Web component driven development
Web component driven developmentWeb component driven development
Web component driven development
 
Web components
Web componentsWeb components
Web components
 
Redux data flow with angular 2
Redux data flow with angular 2Redux data flow with angular 2
Redux data flow with angular 2
 
Biological Modeling, Powered by AngularJS
Biological Modeling, Powered by AngularJSBiological Modeling, Powered by AngularJS
Biological Modeling, Powered by AngularJS
 
Who's afraid of front end databases
Who's afraid of front end databasesWho's afraid of front end databases
Who's afraid of front end databases
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Designing Your Next Generation Web Pages with CSS3

  • 1. Designing Your Next Generation Web Pages with CSS3 Gil Fink CEO, sparXys @gilfink, http://www.gilfink.net
  • 2. Box of Doom Story • How hard it is to create a box with rounded corners?
  • 3. Once Upon a Time… • Creating rounded corners involved: o Constructing the box with images and CSS border property • Left corner image • Right corner image • Usage of border property / Usage of a third border line image o Using a lot of CSS manipulations
  • 4.
  • 5. CSS3 to the Rescue border-radius property
  • 6. Designing Your Next Generation Web Pages with CSS3 Gil Fink CEO, sparXys @gilfink, http://www.gilfink.net
  • 7. Agenda • CSS3: Recap • Transitions, Transformations and Animation • Responsive Design • Q&A • Summary
  • 8. CSS3 in a Nutshell • CSS: Cascading Style Sheets o Describe the presentation semantics of HTML web pages o Helps separate a document’s content from its layout and style • Work on CSS3 began after CSS2 entered the recommendation stage in 1999 • CSS3 is divided into modules o Each module add new capabilities or extend features defined in CSS2
  • 9. What’s new in CSS3? • Transitions • Transformations • Animations • New layout options • Extended existing properties: o Background o Border • And more
  • 10. Transitions • CSS3 support transitions • Use the transition property and element events to apply transitions div { width: 50px; height: 50px; transition: width 2s; /* width change will apply a 2 second transition */ } div:hover { /* hover will trigger the transition */ width: 150px; }
  • 11. Transformations • CSS3 supports two and three dimensional element transformations o Use the transform property with transformation function • You can apply transformations such as o Translate o Scale o Rotate o And more #element { transform: rotate(30deg); }
  • 12. Animation • CSS3 enables simple animations • Use the @keyframes rule and animation property @keyframes myAnim { 0% { right: 0px; } 25% { right: 25px; background: blue; } 75% { right: 75px; background: red; } 100% { right: 100px; } } div { animation: myAnim 5s linear 5s infinite alternate ; }
  • 13. DEMO Transitions, transformations and animations http://desandro.github.io/3dtransforms/exampl es/carousel-02-dynamic.html http://desandro.github.io/3dtransforms/exampl es/cube-02-show-sides.html
  • 14. Responsive Design • Optimization approach for UX view over a range of devices o Mobile, desktop, TV, Tablet and etc. o UI depends on the device and its specifics (resolution, DPI and more)
  • 15. Ways to Create a Responsive Design • Flexible layouts o Flexbox o Multi columns o Grid layout o Other CSS options • Media queries • And more
  • 16. Flexible Layouts • Flexible layouts uses proportional sizes: • How can we do that with CSS3? Sub nav content aside Margins:2% 55%15% 20%
  • 17. Multi Columns • Arrange content in columns like in newspapers • Content flows from one column to another div { width: 200px; column-width: 60px; column-count: 3; column-gap: 2em; }
  • 18. Flexible Box • Position boxed elements inside a container element • Controls how boxed elements relate to one another o Flow direction, order and alignment o Box sizes in response to container size .container { display: flexbox; flex-direction: row; border: 1px solid black; width: 400px; padding: 10px; }
  • 20. Media Queries • Detect media features and respond accordingly • Change the presentation of the content in response to media changes • Consist of a type and zero or more expressions o Types can be screen, projection and resolution o Expressions are the checks that will evaluated
  • 21. Coding Media Queries • If a media query expression is evaluated to true, the styles in the query block are applied • Rule of thumb - put media queries at the end of the CSS file .someDiv { width: 250px; height: 250px; } @media only screen and (max-width: 1024px) { .someDiv { width: 150px; height: 200px; } } @media only screen and (max-width: 800px) { .someDiv { width: 120px; height: 180px; } } @media only screen and (max-width: 320px) { .someDiv { width: 80px; height: 120px; } }
  • 24. Summary • CSS3 changes the way we can design web pages: o More layout and style options o Options to replace JavaScript animation, transitions and transformations • Make use of CSS3 today!