SlideShare a Scribd company logo
June 21, 2017 www.snipe.co.in 1
Prepared :snipe team
June 21, 2017 www.snipe.co.in 2
CSS
June 21, 2017 www.snipe.co.in 3
Overview
Brief History of CSS
• CSS stands for Cascading Style Sheets
• Styles define how to display HTML elements
• Styles were added to HTML 4.0 to solve a problem
• External Style Sheets can save a lot of work
• External Style Sheets are stored in CSS files
June 21, 2017 www.snipe.co.in 4
CSS Id and Class
The id Selector:
• The id selector is used to specify a style for a single, unique element.
• The id selector uses the id attribute of the HTML element, and is
defined with”#".
The class Selector:
• The class selector is used to specify a style for a group of elements.
• The class selector uses the HTML class attribute, and is defined with
a "."
June 21, 2017 www.snipe.co.in 5
How to insert CSS in HTML
• External style sheet
• Internal style sheet
• Inline style
June 21, 2017 www.snipe.co.in 6
External Style Sheet:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>
Internal Style Sheet :
<head>
<style type="text/css">
hr { color:sienna; }
p { margin-left:20px; }
body { background-image:url("images/back40.gif"); }
</style>
</head>
June 21, 2017 www.snipe.co.in 7
CSS Styling
• Background-color
• Background-image
• Background-repeat
• Background-attachment
• Background-position
June 21, 2017 www.snipe.co.in 8
Styling Links
• Links can be style with any CSS property (e.g. color, font-family,
background-color).
• Special for links are that they can be styled differently depending on
what state they are in.
The four links states are:
• a:link - a normal, unvisited link
• a:visited - a link the user has visited
• a:hover - a link when the user mouse over it
• a:active - a link the moment it is clicked
CSS Links
June 21, 2017 www.snipe.co.in 9
CSS Lists
The CSS list properties allow you to:
• Set different list item markers for ordered lists
• Set different list item markers for unordered lists
• Set an image as the list item marker
List
In HTML, there are two types of lists:
• unordered lists - the list items are marked with bullets
• ordered lists - the list items are marked with numbers or letters
June 21, 2017 www.snipe.co.in 10
CSS Tables
Table Borders :
To specify table borders in CSS, use the border property.
Collapse Borders :
The border-collapse property sets whether the table borders are
collapsed into a single border .
Table Width and Height :
Width and height of a table is defined by the width and height
properties.
Table Text Alignment :
The text in a table is aligned with the text-align and vertical-align
properties.
June 21, 2017 www.snipe.co.in 11
CSS Box Model
• All HTML elements can be considered as boxes.
• In CSS, the term "box model" is used when talking about design and
layout.
• The CSS box model is essentially a box that wraps around HTML
elements, and it consists of: margins, borders, padding, and the actual
content.
• The box model allows us to place a border around elements and space
elements in relation to other elements.
June 21, 2017 www.snipe.co.in 12
Margin
• Clears an area around the border.
• The margin does not have a background color, and it is completely
transparent.
Border - A border that lies around the padding and content. The border
is affected by the background color of the box.
Padding - Clears an area around the content. The padding is affected by
the background color of the box.
Content - The content of the box, where text and images appear.
June 21, 2017 www.snipe.co.in 13
CSS Grouping and Nesting Selectors
Grouping Selectors:
In style sheets there are often elements with the same style.
h1{
color:green;
}
h2{
color:green;
}
p{
color:green;
}
June 21, 2017 www.snipe.co.in 14
Nesting Selectors:
It is possible to apply a style for a selector within a selector.
In the example below, one style is specified for all p elements, and a
separate style is specified for p elements nested within the "marked"
class:
Example:
p{
color:blue;
text-align:center;
}
.marked{
background-color:blue;
}
.marked{
color:white;
}
The display property specifies if/how an element is displayed, and the
visibility property specifies if an element should be visible or hidden.
• Hiding an Element - display:none or visibility:hidden
Ex:
h1.hidden {visibility:hidden;}
• CSS Display - Block and Inline Elements
Examples of block elements:
<h1>
<p>
<div>
Examples of inline elements:
<span>
<a>
CSS Display and Visibility
June 21, 2017 www.snipe.co.in 15
• Having easy-to-use navigation is important for any web site.
• With CSS you can transform boring HTML menus into good-looking
navigation bars.
Navigation Bar = List of Links
<ul>
<li><a href="default.asp">Home</a></li>
<li><a href="news.asp">News</a></li>
<li><a href="contact.asp">Contact</a></li>
<li><a href="about.asp">About</a></li>
</ul>
Now let's remove the bullets and the margins and padding from the list:
Example:
ul {
list-style-type : none;
margin:0;
padding:0;
}
June 21, 2017 www.snipe.co.in 16
CSS Navigation Bar
Thank You
June 21, 2017 www.snipe.co.in 17

More Related Content

PPT
Html Expression Web
PPTX
Cascading style sheets (CSS)
PPT
Cascading style sheet (css)]
PPTX
Introducing Cascading Style Sheets
Html Expression Web
Cascading style sheets (CSS)
Cascading style sheet (css)]
Introducing Cascading Style Sheets

What's hot (19)

PPTX
Introduction to CSS
PPTX
Cascading style sheets
PPT
Introduction to Cascading Style Sheets (CSS)
PPTX
Cascading style sheets - CSS
PPTX
Introduction to HTML and CSS
PPTX
Cascading Style Sheets - CSS
PPTX
Cascading Style Sheet (CSS)
PPTX
Cascading Style Sheets (CSS)
PPTX
Week 12 CSS - Review from last week
PPSX
Introduction to css
PDF
Introduction to css
PPTX
Beginners css tutorial for web designers
ODP
Introduction to css & its attributes with syntax
PPT
Introduction to CSS
PPT
Basic css
PPT
Cascading Style Sheets(CSS)
PPTX
Introduction to CSS
PPTX
Howcssworks 100207024009-phpapp01
Introduction to CSS
Cascading style sheets
Introduction to Cascading Style Sheets (CSS)
Cascading style sheets - CSS
Introduction to HTML and CSS
Cascading Style Sheets - CSS
Cascading Style Sheet (CSS)
Cascading Style Sheets (CSS)
Week 12 CSS - Review from last week
Introduction to css
Introduction to css
Beginners css tutorial for web designers
Introduction to css & its attributes with syntax
Introduction to CSS
Basic css
Cascading Style Sheets(CSS)
Introduction to CSS
Howcssworks 100207024009-phpapp01
Ad

Similar to CSS (20)

PPTX
GDG CSS TECH WINTER BREAK VIEW PPT.pptxx
PPTX
GDG CSS TECH WINTER BREAK VIEW PPT.pptxx
PPTX
PPTX
CSS_Day_ONE (W3schools)
PPTX
Complete Lecture on Css presentation
PPT
gdg_workshop 4 on web development HTML & CSS
PPTX
CSS Basics part One
PPTX
CSS tutorial chapter 1
PPTX
PPTX
UNIT 3WOP fgfufhbuiibpvihbvpihivbhibvipuuvbiuvboi
PPTX
basic programming language AND HTML CSS JAVApdf
PDF
Introduction to cascade style sheets CSS.pdf
PPTX
Lecture 9 CSS part 1.pptxType Classification
PPTX
Cascading Style Sheets for web browser.pptx
PPTX
Html Styles-CSS
PPT
Cascading Style Sheets By Mukesh
PPTX
Cascading style sheets (CSS-Web Technology)
PPTX
Introduction to CSS
GDG CSS TECH WINTER BREAK VIEW PPT.pptxx
GDG CSS TECH WINTER BREAK VIEW PPT.pptxx
CSS_Day_ONE (W3schools)
Complete Lecture on Css presentation
gdg_workshop 4 on web development HTML & CSS
CSS Basics part One
CSS tutorial chapter 1
UNIT 3WOP fgfufhbuiibpvihbvpihivbhibvipuuvbiuvboi
basic programming language AND HTML CSS JAVApdf
Introduction to cascade style sheets CSS.pdf
Lecture 9 CSS part 1.pptxType Classification
Cascading Style Sheets for web browser.pptx
Html Styles-CSS
Cascading Style Sheets By Mukesh
Cascading style sheets (CSS-Web Technology)
Introduction to CSS
Ad

More from Mallikarjuna G D (20)

PPTX
PPTX
Bootstrap 5 ppt
PPTX
Angular 2.0
PPTX
Spring andspringboot training
PPTX
Hibernate
PPT
Jspprogramming
PPT
Servlet programming
PPT
Servlet programming
PPTX
Mmg logistics edu-final
PPTX
Interview preparation net_asp_csharp
PPTX
Interview preparation devops
PPTX
Interview preparation testing
PPTX
Interview preparation data_science
PPTX
Interview preparation full_stack_java
PPTX
Enterprunership
PPTX
Core java
PPTX
Type script
PPTX
Angularj2.0
PPTX
Git Overview
PPTX
Bootstrap 5 ppt
Angular 2.0
Spring andspringboot training
Hibernate
Jspprogramming
Servlet programming
Servlet programming
Mmg logistics edu-final
Interview preparation net_asp_csharp
Interview preparation devops
Interview preparation testing
Interview preparation data_science
Interview preparation full_stack_java
Enterprunership
Core java
Type script
Angularj2.0
Git Overview

Recently uploaded (20)

PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Insiders guide to clinical Medicine.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Classroom Observation Tools for Teachers
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Pre independence Education in Inndia.pdf
PPTX
Cell Structure & Organelles in detailed.
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
Institutional Correction lecture only . . .
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Insiders guide to clinical Medicine.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
O7-L3 Supply Chain Operations - ICLT Program
Classroom Observation Tools for Teachers
human mycosis Human fungal infections are called human mycosis..pptx
Abdominal Access Techniques with Prof. Dr. R K Mishra
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Pre independence Education in Inndia.pdf
Cell Structure & Organelles in detailed.
Microbial diseases, their pathogenesis and prophylaxis
FourierSeries-QuestionsWithAnswers(Part-A).pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Microbial disease of the cardiovascular and lymphatic systems
102 student loan defaulters named and shamed – Is someone you know on the list?
Renaissance Architecture: A Journey from Faith to Humanism
Institutional Correction lecture only . . .
Final Presentation General Medicine 03-08-2024.pptx
Week 4 Term 3 Study Techniques revisited.pptx

CSS

  • 1. June 21, 2017 www.snipe.co.in 1 Prepared :snipe team
  • 2. June 21, 2017 www.snipe.co.in 2 CSS
  • 3. June 21, 2017 www.snipe.co.in 3 Overview Brief History of CSS • CSS stands for Cascading Style Sheets • Styles define how to display HTML elements • Styles were added to HTML 4.0 to solve a problem • External Style Sheets can save a lot of work • External Style Sheets are stored in CSS files
  • 4. June 21, 2017 www.snipe.co.in 4 CSS Id and Class The id Selector: • The id selector is used to specify a style for a single, unique element. • The id selector uses the id attribute of the HTML element, and is defined with”#". The class Selector: • The class selector is used to specify a style for a group of elements. • The class selector uses the HTML class attribute, and is defined with a "."
  • 5. June 21, 2017 www.snipe.co.in 5 How to insert CSS in HTML • External style sheet • Internal style sheet • Inline style
  • 6. June 21, 2017 www.snipe.co.in 6 External Style Sheet: <head> <link rel="stylesheet" type="text/css" href="mystyle.css" /> </head> Internal Style Sheet : <head> <style type="text/css"> hr { color:sienna; } p { margin-left:20px; } body { background-image:url("images/back40.gif"); } </style> </head>
  • 7. June 21, 2017 www.snipe.co.in 7 CSS Styling • Background-color • Background-image • Background-repeat • Background-attachment • Background-position
  • 8. June 21, 2017 www.snipe.co.in 8 Styling Links • Links can be style with any CSS property (e.g. color, font-family, background-color). • Special for links are that they can be styled differently depending on what state they are in. The four links states are: • a:link - a normal, unvisited link • a:visited - a link the user has visited • a:hover - a link when the user mouse over it • a:active - a link the moment it is clicked CSS Links
  • 9. June 21, 2017 www.snipe.co.in 9 CSS Lists The CSS list properties allow you to: • Set different list item markers for ordered lists • Set different list item markers for unordered lists • Set an image as the list item marker List In HTML, there are two types of lists: • unordered lists - the list items are marked with bullets • ordered lists - the list items are marked with numbers or letters
  • 10. June 21, 2017 www.snipe.co.in 10 CSS Tables Table Borders : To specify table borders in CSS, use the border property. Collapse Borders : The border-collapse property sets whether the table borders are collapsed into a single border . Table Width and Height : Width and height of a table is defined by the width and height properties. Table Text Alignment : The text in a table is aligned with the text-align and vertical-align properties.
  • 11. June 21, 2017 www.snipe.co.in 11 CSS Box Model • All HTML elements can be considered as boxes. • In CSS, the term "box model" is used when talking about design and layout. • The CSS box model is essentially a box that wraps around HTML elements, and it consists of: margins, borders, padding, and the actual content. • The box model allows us to place a border around elements and space elements in relation to other elements.
  • 12. June 21, 2017 www.snipe.co.in 12 Margin • Clears an area around the border. • The margin does not have a background color, and it is completely transparent. Border - A border that lies around the padding and content. The border is affected by the background color of the box. Padding - Clears an area around the content. The padding is affected by the background color of the box. Content - The content of the box, where text and images appear.
  • 13. June 21, 2017 www.snipe.co.in 13 CSS Grouping and Nesting Selectors Grouping Selectors: In style sheets there are often elements with the same style. h1{ color:green; } h2{ color:green; } p{ color:green; }
  • 14. June 21, 2017 www.snipe.co.in 14 Nesting Selectors: It is possible to apply a style for a selector within a selector. In the example below, one style is specified for all p elements, and a separate style is specified for p elements nested within the "marked" class: Example: p{ color:blue; text-align:center; } .marked{ background-color:blue; } .marked{ color:white; }
  • 15. The display property specifies if/how an element is displayed, and the visibility property specifies if an element should be visible or hidden. • Hiding an Element - display:none or visibility:hidden Ex: h1.hidden {visibility:hidden;} • CSS Display - Block and Inline Elements Examples of block elements: <h1> <p> <div> Examples of inline elements: <span> <a> CSS Display and Visibility June 21, 2017 www.snipe.co.in 15
  • 16. • Having easy-to-use navigation is important for any web site. • With CSS you can transform boring HTML menus into good-looking navigation bars. Navigation Bar = List of Links <ul> <li><a href="default.asp">Home</a></li> <li><a href="news.asp">News</a></li> <li><a href="contact.asp">Contact</a></li> <li><a href="about.asp">About</a></li> </ul> Now let's remove the bullets and the margins and padding from the list: Example: ul { list-style-type : none; margin:0; padding:0; } June 21, 2017 www.snipe.co.in 16 CSS Navigation Bar
  • 17. Thank You June 21, 2017 www.snipe.co.in 17