SlideShare a Scribd company logo
CSS(Cascading Style Sheet)
What is CSS?
The Cascading Style Sheets Specification (CSS) is a computer language that is
used to write formatting instructions (rules). These rules tell a web browser how webpage
content should ‘look’— in terms of:
 Layout:>
position, alignment, width, height, etc.
 Style:>
typeface, font-weight, color, border, etc.
CSS Selectors
There are two most important selector where selectors are patterns used to select
the element(s) you want to style
 Id selector:>
Selects all elements with class
example: class=“Info”
 Class Selector:>
Selects the element with id
example: id=“firstname”
Types of CSS Styles
Inline Style
Internal (embedded) style
External Style
Inline CSS Stylesheet
 Inline styles can not be reused in web page.
 Inline styles are placed directly inside the HTML element
in code.
 All the code for the Internal CSS stylesheet is contained
between the <head></head> section of your websites
code
Example:
<p style="color:red;font-size:18px">This is a paragraph!</p>
Internal CSS Stylesheet
 Internal Styles are placed inside the <head> section of a particular
web page.
 These styles can be used only for the web page in which they are
embedded.
 Advanced used of internal styles unless you need to override an
External Style.
Example:
<head>
<style type="text/css">
h1 {color:blue;}
h2 {color:red;}
</style>
</head>
External CSS Stylesheet
 An External style sheet is a separate page (file) which is
then linked to the web page. Therefore, the styles are
External to, or outside of, the Web Page
 The External style sheet is basically a text file that is
saved as .css file
Example:
<head>
<link rel="stylesheet" type="text/css" href="theme.css">
</head>
Responsive Design
 Responsive web design (RWD) is an approach to web design aimed
at crafting sites to provide an optimal viewing experience—easy reading and
navigation with a minimum of resizing, panning, and scrolling—across a wide
range of devices (from desktop computer monitors to mobile phones).
 Responsive design is an approach to web page creation that makes use
of flexible layouts, flexible images and cascading style sheet media
queries. The goal of responsive design is to build web pages that detect the
visitor’s screen size and orientation and change the layout according
Media Queries
/* Smartphones (portrait and landscape) ----------- */
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen and (min-width : 321px) {
/* Styles */
}
/* Smartphones (portrait) ----------- */
@media only screen and (max-width : 320px) {
/* Styles */
}
/* iPads (portrait and landscape) ----------- */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) {
/* Styles */
}
/* iPads (landscape) ----------- */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and
(orientation : landscape) {
/* Styles */
}
/* iPads (portrait) ----------- */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and
(orientation : portrait) {
/* Styles */
}
/**********
iPad 3
**********/
@media only screen and (min-device-width : 768px) and (max-device-width :
1024px) and (orientation : landscape) and (-webkit-min-device-pixel-ratio : 2) {
/* Styles */
}
@media only screen and (min-device-width : 768px) and (max-device-width :
1024px) and (orientation : portrait) and (-webkit-min-device-pixel-ratio : 2) {
/* Styles */
}
/* Desktops and laptops ----------- */
@media only screen and (min-width : 1224px) {
/* Styles */
}
/* Large screens ----------- */
@media only screen and (min-width : 1824px) {
/* Styles */
}
/* iPhone 4 ----------- */
@media only screen and (min-device-width : 320px) and (max-device-width :
480px) and (orientation : landscape) and (-webkit-min-device-pixel-ratio : 2) {
/* Styles */
}
@media only screen and (min-device-width : 320px) and (max-device-width :
480px) and (orientation : portrait) and (-webkit-min-device-pixel-ratio : 2) {
/* Styles */
}
How To Make Web Page Responsive
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

More Related Content

What's hot

CSS Generator Tools
CSS Generator ToolsCSS Generator Tools
CSS Generator Tools
lillianabe
 
Web programming css
Web programming cssWeb programming css
Web programming css
Uma mohan
 
Web topic 15 1 basic css layout
Web topic 15 1  basic css layoutWeb topic 15 1  basic css layout
Web topic 15 1 basic css layout
CK Yang
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
tutorialsruby
 

What's hot (17)

CSS Generator Tools
CSS Generator ToolsCSS Generator Tools
CSS Generator Tools
 
What is css
What is cssWhat is css
What is css
 
Web programming css
Web programming cssWeb programming css
Web programming css
 
Web topic 15 1 basic css layout
Web topic 15 1  basic css layoutWeb topic 15 1  basic css layout
Web topic 15 1 basic css layout
 
Android training (android style)
Android training (android style)Android training (android style)
Android training (android style)
 
presentation in html,css,javascript
presentation in html,css,javascriptpresentation in html,css,javascript
presentation in html,css,javascript
 
Html
HtmlHtml
Html
 
Css1
Css1Css1
Css1
 
Intro to CSS Selectors in Drupal
Intro to CSS Selectors in DrupalIntro to CSS Selectors in Drupal
Intro to CSS Selectors in Drupal
 
Kajol52
Kajol52Kajol52
Kajol52
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
Introduction to css for product managers
Introduction to css for product managersIntroduction to css for product managers
Introduction to css for product managers
 
Css3
Css3Css3
Css3
 
Introduction to HTML5 and CSS3
Introduction to HTML5 and CSS3Introduction to HTML5 and CSS3
Introduction to HTML5 and CSS3
 
WEBD 162: Intro to CSS
WEBD 162: Intro to CSSWEBD 162: Intro to CSS
WEBD 162: Intro to CSS
 
Web designing training in chandigarh
Web designing training in chandigarhWeb designing training in chandigarh
Web designing training in chandigarh
 
Css and its types
Css and its typesCss and its types
Css and its types
 

Similar to CSS

Responsive website design
Responsive website designResponsive website design
Responsive website design
svaithiyalingam
 
Developing for Responsive Design - Frederic Welterlin
Developing for Responsive Design - Frederic WelterlinDeveloping for Responsive Design - Frederic Welterlin
Developing for Responsive Design - Frederic Welterlin
Razorfish
 
Lect-4-Responsive-Web-06032024-082044am.pptx
Lect-4-Responsive-Web-06032024-082044am.pptxLect-4-Responsive-Web-06032024-082044am.pptx
Lect-4-Responsive-Web-06032024-082044am.pptx
zainm7032
 
The specs behind the sex, mobile-friendly layout beyond the desktop
The specs behind the sex, mobile-friendly layout beyond the desktopThe specs behind the sex, mobile-friendly layout beyond the desktop
The specs behind the sex, mobile-friendly layout beyond the desktop
betabeers
 
Responsive Web Design - What You Need to Know to Get Started
Responsive Web Design - What You Need to Know to Get StartedResponsive Web Design - What You Need to Know to Get Started
Responsive Web Design - What You Need to Know to Get Started
jennybchicken
 
Responsive Vs Dedicated: Insight into Mobile Web
Responsive Vs Dedicated: Insight into Mobile WebResponsive Vs Dedicated: Insight into Mobile Web
Responsive Vs Dedicated: Insight into Mobile Web
Chathuranga Bandara
 

Similar to CSS (20)

Responsive website design
Responsive website designResponsive website design
Responsive website design
 
Responsive Web Design & APEX Theme 25 (OGh APEX World 2014)
Responsive Web Design & APEX Theme 25 (OGh APEX World 2014)Responsive Web Design & APEX Theme 25 (OGh APEX World 2014)
Responsive Web Design & APEX Theme 25 (OGh APEX World 2014)
 
Developing for Responsive Design - Frederic Welterlin
Developing for Responsive Design - Frederic WelterlinDeveloping for Responsive Design - Frederic Welterlin
Developing for Responsive Design - Frederic Welterlin
 
Responsive Web Design & APEX Theme 25
Responsive Web Design & APEX Theme 25Responsive Web Design & APEX Theme 25
Responsive Web Design & APEX Theme 25
 
Lect-4-Responsive-Web-06032024-082044am.pptx
Lect-4-Responsive-Web-06032024-082044am.pptxLect-4-Responsive-Web-06032024-082044am.pptx
Lect-4-Responsive-Web-06032024-082044am.pptx
 
Responsive Web Designing Fundamentals
Responsive Web Designing FundamentalsResponsive Web Designing Fundamentals
Responsive Web Designing Fundamentals
 
Responsive web designing ppt(1)
Responsive web designing ppt(1)Responsive web designing ppt(1)
Responsive web designing ppt(1)
 
Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web Design
 
Managing CSS for a big ass website - at Netlog
Managing CSS for a big ass website - at NetlogManaging CSS for a big ass website - at Netlog
Managing CSS for a big ass website - at Netlog
 
Adaptive layouts - standards>next Manchester 23.03.2011
Adaptive layouts - standards>next Manchester 23.03.2011Adaptive layouts - standards>next Manchester 23.03.2011
Adaptive layouts - standards>next Manchester 23.03.2011
 
The specs behind the sex, mobile-friendly layout beyond the desktop
The specs behind the sex, mobile-friendly layout beyond the desktopThe specs behind the sex, mobile-friendly layout beyond the desktop
The specs behind the sex, mobile-friendly layout beyond the desktop
 
Create a landing page
Create a landing pageCreate a landing page
Create a landing page
 
Responsive Web Design - What You Need to Know to Get Started
Responsive Web Design - What You Need to Know to Get StartedResponsive Web Design - What You Need to Know to Get Started
Responsive Web Design - What You Need to Know to Get Started
 
Digibury: Getting your web presence mobile ready - David Walker
Digibury: Getting your web presence mobile ready - David WalkerDigibury: Getting your web presence mobile ready - David Walker
Digibury: Getting your web presence mobile ready - David Walker
 
Bootstrap 3
Bootstrap 3Bootstrap 3
Bootstrap 3
 
Designing for mobile
Designing for mobileDesigning for mobile
Designing for mobile
 
A Complete Guide to Frontend - UI Developer
A Complete Guide to Frontend - UI DeveloperA Complete Guide to Frontend - UI Developer
A Complete Guide to Frontend - UI Developer
 
Media queries A to Z
Media queries A to ZMedia queries A to Z
Media queries A to Z
 
Responsive Web Design - Devoxx UK - 2014-06-13
Responsive Web Design - Devoxx UK - 2014-06-13Responsive Web Design - Devoxx UK - 2014-06-13
Responsive Web Design - Devoxx UK - 2014-06-13
 
Responsive Vs Dedicated: Insight into Mobile Web
Responsive Vs Dedicated: Insight into Mobile WebResponsive Vs Dedicated: Insight into Mobile Web
Responsive Vs Dedicated: Insight into Mobile Web
 

CSS

  • 2. What is CSS? The Cascading Style Sheets Specification (CSS) is a computer language that is used to write formatting instructions (rules). These rules tell a web browser how webpage content should ‘look’— in terms of:  Layout:> position, alignment, width, height, etc.  Style:> typeface, font-weight, color, border, etc.
  • 3. CSS Selectors There are two most important selector where selectors are patterns used to select the element(s) you want to style  Id selector:> Selects all elements with class example: class=“Info”  Class Selector:> Selects the element with id example: id=“firstname”
  • 4. Types of CSS Styles Inline Style Internal (embedded) style External Style
  • 5. Inline CSS Stylesheet  Inline styles can not be reused in web page.  Inline styles are placed directly inside the HTML element in code.  All the code for the Internal CSS stylesheet is contained between the <head></head> section of your websites code Example: <p style="color:red;font-size:18px">This is a paragraph!</p>
  • 6. Internal CSS Stylesheet  Internal Styles are placed inside the <head> section of a particular web page.  These styles can be used only for the web page in which they are embedded.  Advanced used of internal styles unless you need to override an External Style. Example: <head> <style type="text/css"> h1 {color:blue;} h2 {color:red;} </style> </head>
  • 7. External CSS Stylesheet  An External style sheet is a separate page (file) which is then linked to the web page. Therefore, the styles are External to, or outside of, the Web Page  The External style sheet is basically a text file that is saved as .css file Example: <head> <link rel="stylesheet" type="text/css" href="theme.css"> </head>
  • 8. Responsive Design  Responsive web design (RWD) is an approach to web design aimed at crafting sites to provide an optimal viewing experience—easy reading and navigation with a minimum of resizing, panning, and scrolling—across a wide range of devices (from desktop computer monitors to mobile phones).  Responsive design is an approach to web page creation that makes use of flexible layouts, flexible images and cascading style sheet media queries. The goal of responsive design is to build web pages that detect the visitor’s screen size and orientation and change the layout according
  • 9. Media Queries /* Smartphones (portrait and landscape) ----------- */ @media only screen and (min-device-width : 320px) and (max-device-width : 480px) { /* Styles */ } /* Smartphones (landscape) ----------- */ @media only screen and (min-width : 321px) { /* Styles */ } /* Smartphones (portrait) ----------- */ @media only screen and (max-width : 320px) { /* Styles */ }
  • 10. /* iPads (portrait and landscape) ----------- */ @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) { /* Styles */ } /* iPads (landscape) ----------- */ @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) { /* Styles */ } /* iPads (portrait) ----------- */ @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) { /* Styles */ }
  • 11. /********** iPad 3 **********/ @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) and (-webkit-min-device-pixel-ratio : 2) { /* Styles */ } @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) and (-webkit-min-device-pixel-ratio : 2) { /* Styles */ } /* Desktops and laptops ----------- */ @media only screen and (min-width : 1224px) { /* Styles */ }
  • 12. /* Large screens ----------- */ @media only screen and (min-width : 1824px) { /* Styles */ } /* iPhone 4 ----------- */ @media only screen and (min-device-width : 320px) and (max-device-width : 480px) and (orientation : landscape) and (-webkit-min-device-pixel-ratio : 2) { /* Styles */ } @media only screen and (min-device-width : 320px) and (max-device-width : 480px) and (orientation : portrait) and (-webkit-min-device-pixel-ratio : 2) { /* Styles */ }
  • 13. How To Make Web Page Responsive <meta name="viewport" content="width=device-width, initial-scale=1.0" />