SlideShare a Scribd company logo
New elements in CSS3
Shadow Effect in CSS3
• -moz-box-shadow: 7px 7px 5px #999; /* For shadow effect to work in supported
versions of Mozilla */
• -webkit-box-shadow: 7px 7px 7px #999; /* For shadow effect to work in
supported versions of Safari */
- See more at: http://blog.jmwhite.co.uk/2009/04/19/the-shadow-effect-in-css3/#sthash.XSkRPqSa.dpuf
CSS3 rounded
.rounded_STYLE
{
background-color: COLOR; /* if needed */
border: 1px solid BORDER_COLOR; /* if needed */
-webkit-border-radius: RADIUS; /* for Safari */
-moz-border-radius: RADIUS; /* for Firefox */
}
http://www.bestinclass.com/blog/2008/css3-border-radius-rounded-
corners-ie/
Border-image
• border-image:
• border-top-image
• border-right-image
• border-bottom-image
• border-left-image
• border-corner-image:
• border-top-left-image
• border-top-right-image
• border-bottom-left-image
• border-bottom-right-image
colored borders with CSS3
border: 8px solid #000;
-moz-border-bottom-colors: #555 #666 #777 #888 #999 #aaa #bbb #ccc;
-moz-border-top-colors: #555 #666 #777 #888 #999 #aaa #bbb #ccc;
-moz-border-left-colors: #555 #666 #777 #888 #999 #aaa #bbb #ccc; -moz-border-
right-colors: #555 #666 #777 #888 #999 #aaa #bbb #ccc; padding: 5px 5px 5px
15px;
Opacity Transition
<div style=" background: rgb(255, 0, 0) ; opacity: 0.2;"></div> <div
style=" background: rgb(255, 0, 0) ; opacity: 0.4;"></div> <div style="
background: rgb(255, 0, 0) ; opacity: 0.6;"></div> <div style="
background: rgb(255, 0, 0) ; opacity: 0.8;"></div> <div style="
background: rgb(255, 0, 0) ; opacity: 1;"></div>
RGBA colors
• CSS3 has added a new feature to color setting. Next to rgb you can
now also use rgba.
background: rgba(255, 0, 0, 0.2);
HSL Colors
• (Hue, Saturation, Lightness) values.
background-color: hsl(0,100%, 50%);
HSLA Colors
• As RGBA is to RGB, HSLA is to HSL; that is, it allows a fourth value,
which sets the Opacity (via the Alpha channel)
CSS3 Attribute Selectors
The CSS3 Selectors module introduces three new attribute selectors,
which are grouped together under the heading “Substring Matching
Attribute Selectors”.
• [att^=val] – the “begins with” selector
• [att$=val] – the “ends with” selector
• [att*=val] – the “contains” selecto
CSS3 Attribute Selectors
[att^=val] – the “begins with” selector
The Syntax
• element[att^=val]
Examples
• a[href^="http://"]
• p[title^="Hello"]
Other modules
• CSS3 Transitions
• media queries
• multi-column layout
• Web fonts
• speech
Multi-column layout
-moz-column-width: 13em; -webkit-column-width: 13em; -moz-
column-gap: 1em; -webkit-column-gap: 1em;
CSS3 Transitions
• transition-property
• transition-duration
• transition-timing-function
• transition-delay
http://www.css3.info/preview/css3-transitions/
Web fonts with @font-face
• @font-face { font-family: Delicious; src: url('Delicious-Roman.otf'); }
@font-face { font-family: Delicious; font-weight: bold; src:
url('Delicious-Bold.otf'); }
CSS3 Speech
• #voice-volume { -xv-voice-volume: x-soft; -xv-voice-balance: right; }
#voice-balance { -xv-voice-balance: left; } #speech-cue { cue-after:
url(ding.wav); } #voice-rate { -xv-voice-rate: x-slow; } #voice-family {
voice-family: female; } #voice-pitch { -xv-voice-pitch: x-low; } #speech-
speak { speak: spell-out; }
Media Queries
Why Media Queries
• Change our layouts to fit the exact need of different devices without
changing the content
• “One size fits all” Liquid, elastic and fixed width layouts
Why Media Queries cont.
• Just with CSS – no JavaScript
CSS media types
Media Type Description
all Used for all media type devices
aural Used for speech and sound synthesizers
braille Used for braille tactile feedback devices
embossed Used for paged braille printers
handheld Used for small or handheld devices
print Used for printers
projection Used for projected presentations, like slides
screen Used for computer screens
tty Used for media using a fixed-pitch character grid, like teletypes and
terminals
tv Used for television-type devices
http://www.w3.org/TR/CSS21/media.html
Specify Media
Method 1: <link> within HTML
You can use a <link> element in the head of your HTML document to
specify the target media of an external style sheet. <link
rel="stylesheet" href="a.css" type="text/css" media=”screen" />
Method 2: <?xml stylesheet> within XML
You can use <?xml-stylesheet ?> in the head of your XML document to
specify the target media of an external style sheet. <?xml-stylesheet
media="screen" rel="stylesheet" href="example.css" ?>
Specify Media
Method 3: @import within HTML
You can use @import in the head if your HTML document to specify the
target media of an external style sheet. <style type="text/css"
media="screen"> @import "a.css";</style>
Warning: @import should be avoided as it can cause issues in some
versions of Internet Explorer.
http://www.stevesouders.com/blog/2009/04/09/dont-use-import/
Specify Media
Method 4: @import within CSS
You can specify the target medium within a CSS file using @import
@import url("a.css") screen;
Media-types within @import rules are not supported by IE5, IE6 or IE7.
The rule is ignored.
Method 5: @media within CSS
You can specify the target medium within a CSS file using @media
@media screen { body { color: blue; } }
Media Queries cont…
• It’s a logical type (yes, No)
• If expression is true, it will apply to device
@media all and (min-width: 640px) { #media-queries-1 { background-
color: #0f0; } } @media screen and (max-width: 2000px) { #media-
queries-2 { background-color: #0f0; } }
Element Queries
• Element queries are not part of any CSS Specification. They basically
do not exist as of today. There are a couple of JavaScript-based
polyfills involving various syntaxes, but there is still no draft for a
native support.
SASS
SASS
Sass is an extension of CSS3 which adds nested rules, variables, mixins,
selector inheritance, and more. Sass generates well formatted CSS and
makes your stylesheets easier to organize and maintain.
SASS - Preprocessing
• When stylesheets are getting larger, more complex, and harder to
maintain. This is where a preprocessor can help. Sass lets you use
features that don't exist in CSS yet like variables, nesting, mixins,
inheritance and other nifty goodies that make writing CSS
SASS - Variables
• Think of variables as a way to store information that you want to
reuse throughout your stylesheet. You can store things like colors,
font stacks, or any CSS value you think you'll want to reuse. Sass uses
the $ symbol to make something a variable. Here's an example:
Sass CSS
$font-stack: Helvetica, sans-serif
$primary-color: #333
body
font:100% $font-stack
color: $primary-color
body { font: 100% Helvetica, sans-serif;
color: #333; }
SASS - Nesting
• When writing HTML you've probably noticed that it has a clear nested
and visual hierarchy. CSS, on the other hand, doesn't.
Sass CSS
nav
ul margin: 0 padding: 0 list-style:
none
li display: inline-block
a display: block padding: 6px 12px
text-decoration: none
nav ul {
margin: 0; padding: 0; list-style: none; }
nav li { display: inline-block; }
nav a { display: block; padding: 6px 12px;
text-decoration: none; }
SASS - Partials
• You can create partial Sass files that contain little snippets of CSS that
you can include in other Sass files. This is a great way to modularize
your CSS and help keep things easier to maintain. A partial is simply a
Sass file named with a leading underscore. You might name it
something like _partial.scss. The underscore lets Sass know that the
file is only a partial file and that it should not be generated into a CSS
file. Sass partials are used with the @import directive.
SASS - Import
• CSS has an import option that lets you split your CSS into smaller,
more maintainable portions. The only drawback is that each time you
use @import in CSS it creates another HTTP request. Sass builds on
top of the current CSS @import but instead of requiring an HTTP
request, Sass will take the file that you want to import and combine it
with the file you're importing into so you can serve a single CSS file to
the web browser.
Sass CSS
// _reset.sass html, body, ul, ol margin: 0
padding: 0
// base.sass @import reset body font:
100% Helvetica, sans-serif background-
color: #efefef
html, body, ul, ol { margin: 0; padding: 0;
}
body { font: 100% Helvetica, sans-serif;
background-color: #efefef; }
SASS - Mixins
• A mixin lets you make groups of CSS declarations that you want to
reuse throughout your site. You can even pass in values to make your
mixin more flexible. A good use of a mixin is for vendor prefixes
Sass CSS
=border-radius($radius) -webkit-border-
radius: $radius -moz-border-radius:
$radius -ms-border-radius: $radius
border-radius: $radius
.box +border-radius(10px)
.box { -webkit-border-radius: 10px; -moz-
border-radius: 10px; -ms-border-radius:
10px; border-radius: 10px; }
SASS - Extend/Inheritance
• This is one of the most useful features of Sass. Using @extend lets
you share a set of CSS properties from one selector to another.
Sass CSS
.message border: 1px solid #ccc padding:
10px color: #333
.success @extend
.message border-color: green
.error @extend .message border-color:
red
.warning @extend .message border-
color: yellow
.message, .success, .error, .warning {
border: 1px solid #cccccc; padding: 10px;
color: #333; }
.success { border-color: green; }
.error { border-color: red; }
.warning { border-color: yellow;
SASS - Operators
• Doing math in your CSS is very helpful. Sass has a handful of standard
math operators like +, -, *, /, and %. In our example we're going to do
some simple math to calculate widths for an aside & article.
Sass CSS
.container width: 100%
article[role="main"] float: left width:
600px / 960px * 100%
aside[role="complimentary"] float: right
width: 300px / 960px * 100%
.container { width: 100%; }
article[role="main"] { float: left; width:
62.5%; }
aside[role="complimentary"] { float:
right; width: 31.25%; }
LESS
LESS
• Less (also known as LESS) is a dynamic stylesheet language that can
be compiled into Cascading Style Sheets (CSS), or can run on the
client-side and server-side.
• Less was designed to be as close to CSS as possible, so the syntax is
identical to existing CSS code. As a result, existing CSS can be used as
valid Less code.
• The newer versions of Sass also introduced a CSS-like syntax called
SCSS (Sassy CSS).
Less
• Variables
• Mixins
• Nested rules
• Media query bubbling and nested media queries
• Operations
• Functions
• Namespaces and Accessors
• Scope
• Comments
• Importing
SASS vs LESS
05/16/12 01/12/13 06/25/13
Number of
open issues on
LESS
392 112 142
Number of
open issues on
Sass
84 83 110
Pending pull
requests on
LESS
86 10 5
Pending pull
requests on
Sass
3 7 11
Number of
commits in the
last month in
LESS
11 84 2
Number of
commits in the
last month in
Sass
35 14 14
http://css-tricks.com/sass-vs-less/
Compass
• Compass is an open-source CSS Authoring Framework.
Browser Support
• http://caniuse.com/
• http://www.w3schools.com/cssref/css3_browsersupport.asp
• http://css3test.com/
• Media-types within @import rules are not supported by IE5, IE6 or
IE7. The rule is ignored.
Frameworks
• Bootstrap
• Foundation
• Boilerplate
• Skeleton
Tools
Text Editors
• Sublime Text
Brackets
Other tools
• Yo
• Bower
• Grunt
• Phantom.js
• Jasmin
• Karma
Best Practice
Minimize HTTP Requests
• Combined files
• CSS Sprites
• Image maps
• Inline images - This can increase the size of your HTML document.
• Convert to Base 64
• Use CDN
• Add an Expires or a Cache-Control Header
• For static components: implement "Never expire" policy by setting far future
Expires header
• For dynamic components: use an appropriate Cache-Control header to help
the browser with conditional requests
• Gzip Components
• Accept-Encoding: gzip, deflate
• Content-Encoding: gzip
• Put Stylesheets at the Top
• Put Scripts at the Bottom (if the script uses document.write to insert
part of the page's content)
• Make JavaScript and CSS External
• Reduce DNS Lookups (add more hostnames)
• Minify JavaScript and CSS
• Avoid Redirects
HTTP/1.1 301 Moved Permanently
Location: http://example.com/newuri
Content-Type: text/html
• Remove Duplicate Scripts
• Reduce the Number of DOM Elements
• Split Components Across Domains
• Avoid Empty Image src
• Optimize CSS Sprites
• Minimize DOM Access
•
Others
• HTML5 Doctor CSS Reset - http://html5doctor.com/html-5-reset-
stylesheet/
• Lazy loading

More Related Content

What's hot

Sass
SassSass
CSS Reset
CSS ResetCSS Reset
CSS Reset
Russ Weakley
 
Write LESS. DO more.
Write LESS. DO more.Write LESS. DO more.
Write LESS. DO more.
Eugene Nor
 
Intro to CSS3
Intro to CSS3Intro to CSS3
Intro to CSS3
Denise Jacobs
 
Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compass
Nick Cooley
 
Sass and compass workshop
Sass and compass workshopSass and compass workshop
Sass and compass workshop
Shaho Toofani
 
Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors.
The University of Akron
 
CSS3: Simply Responsive
CSS3: Simply ResponsiveCSS3: Simply Responsive
CSS3: Simply Responsive
Denise Jacobs
 
Authoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & SassAuthoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & Sass
chriseppstein
 
Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)
Tahmina Khatoon
 
Wrangling the CSS Beast with Sass
Wrangling the CSS Beast  with SassWrangling the CSS Beast  with Sass
Wrangling the CSS Beast with Sass
Rob Friesel
 
Quality Development with CSS3
Quality Development with CSS3Quality Development with CSS3
Quality Development with CSS3Shay Howe
 
Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3
Tadpole Collective
 
CSS pattern libraries
CSS pattern librariesCSS pattern libraries
CSS pattern libraries
Russ Weakley
 
CSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y tryingCSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y trying
James Cryer
 
CSS3 - is everything we used to do wrong?
CSS3 - is everything we used to do wrong? CSS3 - is everything we used to do wrong?
CSS3 - is everything we used to do wrong?
Russ Weakley
 
About Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSAbout Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JS
Naga Harish M
 
Modular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS WorkshopModular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS Workshop
Shay Howe
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media Queries
Russ Weakley
 

What's hot (20)

Sass
SassSass
Sass
 
CSS Reset
CSS ResetCSS Reset
CSS Reset
 
Write LESS. DO more.
Write LESS. DO more.Write LESS. DO more.
Write LESS. DO more.
 
Intro to CSS3
Intro to CSS3Intro to CSS3
Intro to CSS3
 
Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compass
 
Sass and compass workshop
Sass and compass workshopSass and compass workshop
Sass and compass workshop
 
SASS Lecture
SASS Lecture SASS Lecture
SASS Lecture
 
Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors.
 
CSS3: Simply Responsive
CSS3: Simply ResponsiveCSS3: Simply Responsive
CSS3: Simply Responsive
 
Authoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & SassAuthoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & Sass
 
Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)
 
Wrangling the CSS Beast with Sass
Wrangling the CSS Beast  with SassWrangling the CSS Beast  with Sass
Wrangling the CSS Beast with Sass
 
Quality Development with CSS3
Quality Development with CSS3Quality Development with CSS3
Quality Development with CSS3
 
Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3
 
CSS pattern libraries
CSS pattern librariesCSS pattern libraries
CSS pattern libraries
 
CSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y tryingCSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y trying
 
CSS3 - is everything we used to do wrong?
CSS3 - is everything we used to do wrong? CSS3 - is everything we used to do wrong?
CSS3 - is everything we used to do wrong?
 
About Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSAbout Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JS
 
Modular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS WorkshopModular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS Workshop
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media Queries
 

Similar to CSS3

SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
Marco Pinheiro
 
UNIT 3.ppt
UNIT 3.pptUNIT 3.ppt
UNIT 3.ppt
kavi806657
 
Create SASSy web parts in SPFx
Create SASSy web parts in SPFxCreate SASSy web parts in SPFx
Create SASSy web parts in SPFx
Stefan Bauer
 
[Bauer] SASSy web parts with SPFX
[Bauer] SASSy web parts with SPFX[Bauer] SASSy web parts with SPFX
[Bauer] SASSy web parts with SPFX
European Collaboration Summit
 
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 4Erin M. Kidwell
 
Sass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by ShafeeqSass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by Shafeeq
DignitasDigital1
 
Create SASSY Web Parts - SPSMilan
Create SASSY Web Parts - SPSMilan Create SASSY Web Parts - SPSMilan
Create SASSY Web Parts - SPSMilan
Stefan Bauer
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)
emrox
 
Sass_Cubet seminar
Sass_Cubet seminarSass_Cubet seminar
Sass_Cubet seminar
Cubet Techno Labs
 
Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01
Anam Hossain
 
CSS preprocessor: why and how
CSS preprocessor: why and howCSS preprocessor: why and how
CSS preprocessor: why and howmirahman
 
Understanding sass
Understanding sassUnderstanding sass
Understanding sass
Mario Hernandez
 
SCSS Implementation
SCSS ImplementationSCSS Implementation
SCSS Implementation
Amey Parab
 
SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESSItai Koren
 
SASS Preprocessor
SASS PreprocessorSASS Preprocessor
SASS Preprocessor
Webkul Software Pvt. Ltd.
 
Fasten RWD Development with Sass
Fasten RWD Development with SassFasten RWD Development with Sass
Fasten RWD Development with Sass
Sven Wolfermann
 
PostCss
PostCssPostCss
PostCss
LearningTech
 
Joes sass presentation
Joes sass presentationJoes sass presentation
Joes sass presentation
JoeSeckelman
 
Stop your share point css become a di-sass-ter today - SPS Munich
Stop your share point css become a di-sass-ter today - SPS MunichStop your share point css become a di-sass-ter today - SPS Munich
Stop your share point css become a di-sass-ter today - SPS Munich
Stefan Bauer
 

Similar to CSS3 (20)

SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
 
UNIT 3.ppt
UNIT 3.pptUNIT 3.ppt
UNIT 3.ppt
 
Create SASSy web parts in SPFx
Create SASSy web parts in SPFxCreate SASSy web parts in SPFx
Create SASSy web parts in SPFx
 
[Bauer] SASSy web parts with SPFX
[Bauer] SASSy web parts with SPFX[Bauer] SASSy web parts with SPFX
[Bauer] SASSy web parts with SPFX
 
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
 
Sass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by ShafeeqSass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by Shafeeq
 
Create SASSY Web Parts - SPSMilan
Create SASSY Web Parts - SPSMilan Create SASSY Web Parts - SPSMilan
Create SASSY Web Parts - SPSMilan
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)
 
Sass_Cubet seminar
Sass_Cubet seminarSass_Cubet seminar
Sass_Cubet seminar
 
Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01
 
CSS preprocessor: why and how
CSS preprocessor: why and howCSS preprocessor: why and how
CSS preprocessor: why and how
 
Understanding sass
Understanding sassUnderstanding sass
Understanding sass
 
SCSS Implementation
SCSS ImplementationSCSS Implementation
SCSS Implementation
 
SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESS
 
SASS Preprocessor
SASS PreprocessorSASS Preprocessor
SASS Preprocessor
 
Fasten RWD Development with Sass
Fasten RWD Development with SassFasten RWD Development with Sass
Fasten RWD Development with Sass
 
PostCss
PostCssPostCss
PostCss
 
Joes sass presentation
Joes sass presentationJoes sass presentation
Joes sass presentation
 
Sass compass
Sass compassSass compass
Sass compass
 
Stop your share point css become a di-sass-ter today - SPS Munich
Stop your share point css become a di-sass-ter today - SPS MunichStop your share point css become a di-sass-ter today - SPS Munich
Stop your share point css become a di-sass-ter today - SPS Munich
 

More from Chathuranga Jayanath

Redux Tech Talk
Redux Tech TalkRedux Tech Talk
Redux Tech Talk
Chathuranga Jayanath
 
Uml Basics
Uml Basics Uml Basics
How To Say NO!
How To Say NO! How To Say NO!
How To Say NO!
Chathuranga Jayanath
 
Inauguration of Vision Academy of Professional Studies
Inauguration of Vision Academy of Professional Studies Inauguration of Vision Academy of Professional Studies
Inauguration of Vision Academy of Professional Studies
Chathuranga Jayanath
 
I os 6 to ios7 User Interface Perspective
I os 6  to  ios7 User Interface Perspective I os 6  to  ios7 User Interface Perspective
I os 6 to ios7 User Interface Perspective
Chathuranga Jayanath
 
Moodle for students and teachers
Moodle for students and teachersMoodle for students and teachers
Moodle for students and teachers
Chathuranga Jayanath
 

More from Chathuranga Jayanath (7)

Redux Tech Talk
Redux Tech TalkRedux Tech Talk
Redux Tech Talk
 
Uml Basics
Uml Basics Uml Basics
Uml Basics
 
How To Say NO!
How To Say NO! How To Say NO!
How To Say NO!
 
Inauguration of Vision Academy of Professional Studies
Inauguration of Vision Academy of Professional Studies Inauguration of Vision Academy of Professional Studies
Inauguration of Vision Academy of Professional Studies
 
I os 6 to ios7 User Interface Perspective
I os 6  to  ios7 User Interface Perspective I os 6  to  ios7 User Interface Perspective
I os 6 to ios7 User Interface Perspective
 
Moodle for students and teachers
Moodle for students and teachersMoodle for students and teachers
Moodle for students and teachers
 
SLIIT - GTUG Introduction
SLIIT - GTUG IntroductionSLIIT - GTUG Introduction
SLIIT - GTUG Introduction
 

Recently uploaded

State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 

Recently uploaded (20)

State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 

CSS3

  • 1.
  • 3. Shadow Effect in CSS3 • -moz-box-shadow: 7px 7px 5px #999; /* For shadow effect to work in supported versions of Mozilla */ • -webkit-box-shadow: 7px 7px 7px #999; /* For shadow effect to work in supported versions of Safari */ - See more at: http://blog.jmwhite.co.uk/2009/04/19/the-shadow-effect-in-css3/#sthash.XSkRPqSa.dpuf
  • 4. CSS3 rounded .rounded_STYLE { background-color: COLOR; /* if needed */ border: 1px solid BORDER_COLOR; /* if needed */ -webkit-border-radius: RADIUS; /* for Safari */ -moz-border-radius: RADIUS; /* for Firefox */ } http://www.bestinclass.com/blog/2008/css3-border-radius-rounded- corners-ie/
  • 5. Border-image • border-image: • border-top-image • border-right-image • border-bottom-image • border-left-image • border-corner-image: • border-top-left-image • border-top-right-image • border-bottom-left-image • border-bottom-right-image
  • 6. colored borders with CSS3 border: 8px solid #000; -moz-border-bottom-colors: #555 #666 #777 #888 #999 #aaa #bbb #ccc; -moz-border-top-colors: #555 #666 #777 #888 #999 #aaa #bbb #ccc; -moz-border-left-colors: #555 #666 #777 #888 #999 #aaa #bbb #ccc; -moz-border- right-colors: #555 #666 #777 #888 #999 #aaa #bbb #ccc; padding: 5px 5px 5px 15px;
  • 7. Opacity Transition <div style=" background: rgb(255, 0, 0) ; opacity: 0.2;"></div> <div style=" background: rgb(255, 0, 0) ; opacity: 0.4;"></div> <div style=" background: rgb(255, 0, 0) ; opacity: 0.6;"></div> <div style=" background: rgb(255, 0, 0) ; opacity: 0.8;"></div> <div style=" background: rgb(255, 0, 0) ; opacity: 1;"></div>
  • 8. RGBA colors • CSS3 has added a new feature to color setting. Next to rgb you can now also use rgba. background: rgba(255, 0, 0, 0.2);
  • 9. HSL Colors • (Hue, Saturation, Lightness) values. background-color: hsl(0,100%, 50%);
  • 10. HSLA Colors • As RGBA is to RGB, HSLA is to HSL; that is, it allows a fourth value, which sets the Opacity (via the Alpha channel)
  • 11. CSS3 Attribute Selectors The CSS3 Selectors module introduces three new attribute selectors, which are grouped together under the heading “Substring Matching Attribute Selectors”. • [att^=val] – the “begins with” selector • [att$=val] – the “ends with” selector • [att*=val] – the “contains” selecto
  • 12. CSS3 Attribute Selectors [att^=val] – the “begins with” selector The Syntax • element[att^=val] Examples • a[href^="http://"] • p[title^="Hello"]
  • 13. Other modules • CSS3 Transitions • media queries • multi-column layout • Web fonts • speech
  • 14. Multi-column layout -moz-column-width: 13em; -webkit-column-width: 13em; -moz- column-gap: 1em; -webkit-column-gap: 1em;
  • 15. CSS3 Transitions • transition-property • transition-duration • transition-timing-function • transition-delay http://www.css3.info/preview/css3-transitions/
  • 16. Web fonts with @font-face • @font-face { font-family: Delicious; src: url('Delicious-Roman.otf'); } @font-face { font-family: Delicious; font-weight: bold; src: url('Delicious-Bold.otf'); }
  • 17. CSS3 Speech • #voice-volume { -xv-voice-volume: x-soft; -xv-voice-balance: right; } #voice-balance { -xv-voice-balance: left; } #speech-cue { cue-after: url(ding.wav); } #voice-rate { -xv-voice-rate: x-slow; } #voice-family { voice-family: female; } #voice-pitch { -xv-voice-pitch: x-low; } #speech- speak { speak: spell-out; }
  • 19. Why Media Queries • Change our layouts to fit the exact need of different devices without changing the content • “One size fits all” Liquid, elastic and fixed width layouts
  • 20. Why Media Queries cont. • Just with CSS – no JavaScript
  • 21. CSS media types Media Type Description all Used for all media type devices aural Used for speech and sound synthesizers braille Used for braille tactile feedback devices embossed Used for paged braille printers handheld Used for small or handheld devices print Used for printers projection Used for projected presentations, like slides screen Used for computer screens tty Used for media using a fixed-pitch character grid, like teletypes and terminals tv Used for television-type devices http://www.w3.org/TR/CSS21/media.html
  • 22. Specify Media Method 1: <link> within HTML You can use a <link> element in the head of your HTML document to specify the target media of an external style sheet. <link rel="stylesheet" href="a.css" type="text/css" media=”screen" /> Method 2: <?xml stylesheet> within XML You can use <?xml-stylesheet ?> in the head of your XML document to specify the target media of an external style sheet. <?xml-stylesheet media="screen" rel="stylesheet" href="example.css" ?>
  • 23. Specify Media Method 3: @import within HTML You can use @import in the head if your HTML document to specify the target media of an external style sheet. <style type="text/css" media="screen"> @import "a.css";</style> Warning: @import should be avoided as it can cause issues in some versions of Internet Explorer. http://www.stevesouders.com/blog/2009/04/09/dont-use-import/
  • 24. Specify Media Method 4: @import within CSS You can specify the target medium within a CSS file using @import @import url("a.css") screen; Media-types within @import rules are not supported by IE5, IE6 or IE7. The rule is ignored. Method 5: @media within CSS You can specify the target medium within a CSS file using @media @media screen { body { color: blue; } }
  • 25. Media Queries cont… • It’s a logical type (yes, No) • If expression is true, it will apply to device @media all and (min-width: 640px) { #media-queries-1 { background- color: #0f0; } } @media screen and (max-width: 2000px) { #media- queries-2 { background-color: #0f0; } }
  • 27. • Element queries are not part of any CSS Specification. They basically do not exist as of today. There are a couple of JavaScript-based polyfills involving various syntaxes, but there is still no draft for a native support.
  • 28. SASS
  • 29. SASS Sass is an extension of CSS3 which adds nested rules, variables, mixins, selector inheritance, and more. Sass generates well formatted CSS and makes your stylesheets easier to organize and maintain.
  • 30. SASS - Preprocessing • When stylesheets are getting larger, more complex, and harder to maintain. This is where a preprocessor can help. Sass lets you use features that don't exist in CSS yet like variables, nesting, mixins, inheritance and other nifty goodies that make writing CSS
  • 31. SASS - Variables • Think of variables as a way to store information that you want to reuse throughout your stylesheet. You can store things like colors, font stacks, or any CSS value you think you'll want to reuse. Sass uses the $ symbol to make something a variable. Here's an example: Sass CSS $font-stack: Helvetica, sans-serif $primary-color: #333 body font:100% $font-stack color: $primary-color body { font: 100% Helvetica, sans-serif; color: #333; }
  • 32. SASS - Nesting • When writing HTML you've probably noticed that it has a clear nested and visual hierarchy. CSS, on the other hand, doesn't. Sass CSS nav ul margin: 0 padding: 0 list-style: none li display: inline-block a display: block padding: 6px 12px text-decoration: none nav ul { margin: 0; padding: 0; list-style: none; } nav li { display: inline-block; } nav a { display: block; padding: 6px 12px; text-decoration: none; }
  • 33. SASS - Partials • You can create partial Sass files that contain little snippets of CSS that you can include in other Sass files. This is a great way to modularize your CSS and help keep things easier to maintain. A partial is simply a Sass file named with a leading underscore. You might name it something like _partial.scss. The underscore lets Sass know that the file is only a partial file and that it should not be generated into a CSS file. Sass partials are used with the @import directive.
  • 34. SASS - Import • CSS has an import option that lets you split your CSS into smaller, more maintainable portions. The only drawback is that each time you use @import in CSS it creates another HTTP request. Sass builds on top of the current CSS @import but instead of requiring an HTTP request, Sass will take the file that you want to import and combine it with the file you're importing into so you can serve a single CSS file to the web browser. Sass CSS // _reset.sass html, body, ul, ol margin: 0 padding: 0 // base.sass @import reset body font: 100% Helvetica, sans-serif background- color: #efefef html, body, ul, ol { margin: 0; padding: 0; } body { font: 100% Helvetica, sans-serif; background-color: #efefef; }
  • 35. SASS - Mixins • A mixin lets you make groups of CSS declarations that you want to reuse throughout your site. You can even pass in values to make your mixin more flexible. A good use of a mixin is for vendor prefixes Sass CSS =border-radius($radius) -webkit-border- radius: $radius -moz-border-radius: $radius -ms-border-radius: $radius border-radius: $radius .box +border-radius(10px) .box { -webkit-border-radius: 10px; -moz- border-radius: 10px; -ms-border-radius: 10px; border-radius: 10px; }
  • 36. SASS - Extend/Inheritance • This is one of the most useful features of Sass. Using @extend lets you share a set of CSS properties from one selector to another. Sass CSS .message border: 1px solid #ccc padding: 10px color: #333 .success @extend .message border-color: green .error @extend .message border-color: red .warning @extend .message border- color: yellow .message, .success, .error, .warning { border: 1px solid #cccccc; padding: 10px; color: #333; } .success { border-color: green; } .error { border-color: red; } .warning { border-color: yellow;
  • 37. SASS - Operators • Doing math in your CSS is very helpful. Sass has a handful of standard math operators like +, -, *, /, and %. In our example we're going to do some simple math to calculate widths for an aside & article. Sass CSS .container width: 100% article[role="main"] float: left width: 600px / 960px * 100% aside[role="complimentary"] float: right width: 300px / 960px * 100% .container { width: 100%; } article[role="main"] { float: left; width: 62.5%; } aside[role="complimentary"] { float: right; width: 31.25%; }
  • 38. LESS
  • 39. LESS • Less (also known as LESS) is a dynamic stylesheet language that can be compiled into Cascading Style Sheets (CSS), or can run on the client-side and server-side.
  • 40. • Less was designed to be as close to CSS as possible, so the syntax is identical to existing CSS code. As a result, existing CSS can be used as valid Less code. • The newer versions of Sass also introduced a CSS-like syntax called SCSS (Sassy CSS).
  • 41. Less • Variables • Mixins • Nested rules • Media query bubbling and nested media queries • Operations • Functions • Namespaces and Accessors • Scope • Comments • Importing
  • 42. SASS vs LESS 05/16/12 01/12/13 06/25/13 Number of open issues on LESS 392 112 142 Number of open issues on Sass 84 83 110 Pending pull requests on LESS 86 10 5 Pending pull requests on Sass 3 7 11 Number of commits in the last month in LESS 11 84 2 Number of commits in the last month in Sass 35 14 14 http://css-tricks.com/sass-vs-less/
  • 44. • Compass is an open-source CSS Authoring Framework.
  • 47. • Media-types within @import rules are not supported by IE5, IE6 or IE7. The rule is ignored.
  • 49. • Bootstrap • Foundation • Boilerplate • Skeleton
  • 50. Tools
  • 51. Text Editors • Sublime Text Brackets
  • 52. Other tools • Yo • Bower • Grunt • Phantom.js • Jasmin • Karma
  • 54. Minimize HTTP Requests • Combined files • CSS Sprites • Image maps • Inline images - This can increase the size of your HTML document. • Convert to Base 64
  • 55. • Use CDN • Add an Expires or a Cache-Control Header • For static components: implement "Never expire" policy by setting far future Expires header • For dynamic components: use an appropriate Cache-Control header to help the browser with conditional requests • Gzip Components • Accept-Encoding: gzip, deflate • Content-Encoding: gzip
  • 56. • Put Stylesheets at the Top • Put Scripts at the Bottom (if the script uses document.write to insert part of the page's content) • Make JavaScript and CSS External • Reduce DNS Lookups (add more hostnames) • Minify JavaScript and CSS
  • 57. • Avoid Redirects HTTP/1.1 301 Moved Permanently Location: http://example.com/newuri Content-Type: text/html • Remove Duplicate Scripts • Reduce the Number of DOM Elements • Split Components Across Domains
  • 58. • Avoid Empty Image src • Optimize CSS Sprites • Minimize DOM Access •
  • 60. • HTML5 Doctor CSS Reset - http://html5doctor.com/html-5-reset- stylesheet/ • Lazy loading