SlideShare a Scribd company logo
What is Css ?
 CSS stands for Cascading Style Sheets
 Styles define how to display HTML elements
 Styles are normally stored in Style Sheets

 Styles were added to HTML 4.0 to solve a problem
 External Style Sheets can save you a lot of work
 External Style Sheets are stored in CSS files
 Multiple style definitions will cascade into one
Basic Syntax
 The CSS syntax is made up of three parts: a selector, a property and a value:

selector {property: value}
 The property and value are separated by a colon, and surrounded by curly braces:
body {color: black}
 more than one property, you must separate each property with a semicolon.
p {text-align:center;color:red}
For more readable format syntax like
p
{
text-align: center;
color: black;
font-family: arial
}
Basic Syntax…
 Grouping : You can group selectors. Separate each selector with a comma.

Example : h1,h2,h3,h4,h5,h6
{ color: green }
 The class Selector : With the class selector you can define different styles for the
same
type of HTML element.
How to Insert a Style Sheet
 When a browser reads a style sheet, it will format the document according to it.
There are three ways of inserting a style sheet:

 (1) External Style Sheet

 (2) Internal Style Sheet
 (3) Multiple Style Sheets
External Style Sheet
 An external style sheet is ideal when the style is applied to many pages. With an
external style sheet, you can change the look of an entire Web site by changing
one file. Each page must link to the style sheet using the <link> tag. The <link> tag
goes inside the head section:
Internal Style Sheet
 An internal style sheet should be used when a single document has a unique style.
You define internal styles in the head section by using the <style> tag, like this:
Multiple Style Sheets
 If some properties have been set for the same selector in different style sheets, the
values will be inherited from the more specific style sheet.
Background Image, Color…
Color :

Bgimage :

<head>
<style type="text/css">
body {background-color: yellow}
h1 {background-color: #00ff00}
h2 {background-color: transparent}
p {background-color: rgb(250,0,255)}
</style>

<head>

</head>

<style type="text/css">
body
{
background-image:
url('bgdesert.jpg')
}
</style>

<body>

</head>

<h1>This is header 1</h1>
<h2>This is header 2</h2>
<p>This is a paragraph</p>

<body>
</body>

</body>
Background Properties
Text Style
(1)Color:
<html>
<head>
<style type="text/css">
h1 {color: #00ff00}
h2 {color: #dda0dd}
p {color: rgb(0,0,255)}
</style>
</head>

(2) Alignment:
<html>
<head>
<style type="text/css">
h1 {text-align: center}
h2 {text-align: left}
h3 {text-align: right}
</style>
</head>

(3) Control text:
<html>
<head>
<style type="text/css">
p.uppercase {text-transform: uppercase}
p.lowercase {text-transform: lowercase}
p.capitalize {text-transform: capitalize}
</style>
</head>
<body>
<p class="uppercase">This is Text</p>

<body>
<body>
<h1>This is header 1</h1>
<h1>This is header 1</h1> <h2>This is header 2</h2> <p class="lowercase">This is Text</p>
<h2>This is header 2</h2> <h3>This is header 3</h3>
<p class="capitalize">This is Text</p>
<p>This is a paragraph</p> </body>
</body>
</body>
</html>
</html>
</html>
Font Style
(1)Font Family :
<html>
<head>
<style type="text/css">
h3 {font-family: times}
p {font-family: courier}
p.sansserif {font-family: sans-serif}
</style>
</head>
<body>
<h3>This is header 3</h3>
<p>This is a paragraph</p>
<p class="sansserif">This is a
paragraph</p>
</body>
</html>

(2) Font property one Declaration

<html>
<head>
<style type="text/css">
p
{
font: italic small-caps 900 12px arial
}
</style>
</head>
<body>
<p>This is a paragraph</p>
</body>
</html>
Border Style
(1) Simple Border

(2) Borders on each side

<html>
<head>
<style type="text/css">
p
{
border: medium double rgb(250,0,255)
}
</style>
</head>

<html>
<head>
<style type="text/css">
p.soliddouble {border-style: solid double}
p.doublesolid {border-style: double solid}
p.groovedouble {border-style: groove double}
p.three {border-style: solid double groove}
</style>
</head>

<body>
<p>Some text</p>
</body>

<body>
<p class="soliddouble">Some text</p>
<p class="doublesolid">Some text</p>
<p class="groovedouble">Some text</p>
<p class="three">Some text</p>
</body>
</html>

</html>
Margin Style
(1) Simple Margin
<html>
<head>
<style type="text/css">
p.margin {margin: 2cm 4cm 3cm 4cm}
</style>
</head>
<body>
<p>This is a paragraph with no specified
margins</p>
<p class="margin">This is a paragraph with
specified margins</p>
<p>This is a paragraph with no specified
margins</p>
</body>
</html>
Padding Style
(1) Simple Padding
<html>
<head>
<style type="text/css">
td {padding-top: 2cm}
</style>
</head>
<body>
<table border="1">
<tr>
<td>
This is a tablecell with a top padding
</td>
</tr>
</table>
</body>
</html>
List Style
<html>
<head>
<style type="text/css">
ul.disc {list-style-type: disc}
ul.circle {list-style-type: circle}
ul.square {list-style-type: square}
ul.none {list-style-type: none}
</style>
</head>
<body>
<ul class="disc">
<li>Coffee</li>
<li>Tea</li>
<li>Coca Cola</li>
</ul>

<ul class="circle">
<li>Coffee</li>
<li>Tea</li>
<li>Coca Cola</li>
</ul>
<ul class="square">
<li>Coffee</li>
<li>Tea</li>
<li>Coca Cola</li>
For Ordered List
</ul>
<ul class="none">
<li>Coffee</li>
<li>Tea</li>
<li>Coca Cola</li>
</ul>
</body>
</html>

<style type="text/css">
ol.decimal {list-style-type: decimal}
ol.lroman {list-style-type: lower-roman}
ol.uroman {list-style-type: upper-roman}
ol.lalpha {list-style-type: lower-alpha}
ol.ualpha {list-style-type: upper-alpha}
</style>

More Related Content

PPTX
Introduction to CSS
PPTX
Html Styles-CSS
PPT
Cascading Style Sheet | CSS
PPTX
CSS (Cascading Style Sheet)
PPTX
Css Basics
DOC
Css introduction
PPTX
Cascading Style Sheet
PDF
Introduction to css
Introduction to CSS
Html Styles-CSS
Cascading Style Sheet | CSS
CSS (Cascading Style Sheet)
Css Basics
Css introduction
Cascading Style Sheet
Introduction to css

What's hot (20)

PPTX
Week 12 CSS - Review from last week
PPTX
Cascading style sheets (CSS)
PPTX
Html styles
PPTX
chitra
PPTX
PPTX
Session v(css)
PPT
HTML (Hyper Text Markup Language) by Mukesh
PPTX
Session on common html table
PPSX
Introduction to css
PPT
Basic tags
PPT
Basic tags
PPTX
HTML [Basic] --by Abdulla-al Baset
PPTX
Cascading Style Sheets (CSS)
PDF
TUTORIAL DE CSS 2.0
PDF
Introduction to CSS
PPTX
Cascading style sheet
PPT
Css lecture notes
PPTX
Css module1
PPT
CSS
Week 12 CSS - Review from last week
Cascading style sheets (CSS)
Html styles
chitra
Session v(css)
HTML (Hyper Text Markup Language) by Mukesh
Session on common html table
Introduction to css
Basic tags
Basic tags
HTML [Basic] --by Abdulla-al Baset
Cascading Style Sheets (CSS)
TUTORIAL DE CSS 2.0
Introduction to CSS
Cascading style sheet
Css lecture notes
Css module1
CSS
Ad

Viewers also liked (6)

PPTX
Html starting
PPTX
Difference Between HTML and HTML5
PDF
Up to Speed on HTML 5 and CSS 3
PDF
Hype vs. Reality: The AI Explainer
PDF
Study: The Future of VR, AR and Self-Driving Cars
Html starting
Difference Between HTML and HTML5
Up to Speed on HTML 5 and CSS 3
Hype vs. Reality: The AI Explainer
Study: The Future of VR, AR and Self-Driving Cars
Ad

Similar to Css starting (20)

PDF
cdocumentsandsettingsstudentdesktopnewfolderhtmlcss-100220030010-phpapp01.pdf
PDF
CSCADING style sheet. Internal external inline
PDF
css-ppt.pdf
PPTX
PPT
Css siva
PPT
Css siva
PPTX
05. session 05 introducing css
PPT
Learning CSS for beginners.ppt all that are but
PPT
ch04-css-basics_final.ppt
PPTX
CSS____4563276__HTML___________0989.pptx
PPT
Cascading Style Sheet
PPT
6_CasCadingStylesSheetsCSS.ppt
PPTX
Web Engineering - Introduction to CSS
PPT
Cascading style sheet
DOC
Css 1
 
PPT
AK css
PPTX
4_css_intro.pptx. this ppt is based on css which is the required of web deve...
cdocumentsandsettingsstudentdesktopnewfolderhtmlcss-100220030010-phpapp01.pdf
CSCADING style sheet. Internal external inline
css-ppt.pdf
Css siva
Css siva
05. session 05 introducing css
Learning CSS for beginners.ppt all that are but
ch04-css-basics_final.ppt
CSS____4563276__HTML___________0989.pptx
Cascading Style Sheet
6_CasCadingStylesSheetsCSS.ppt
Web Engineering - Introduction to CSS
Cascading style sheet
Css 1
 
AK css
4_css_intro.pptx. this ppt is based on css which is the required of web deve...

Recently uploaded (20)

PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
Pharma ospi slides which help in ospi learning
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Lesson notes of climatology university.
PDF
Insiders guide to clinical Medicine.pdf
PDF
Classroom Observation Tools for Teachers
PDF
Basic Mud Logging Guide for educational purpose
PPTX
Cell Types and Its function , kingdom of life
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Cell Structure & Organelles in detailed.
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Pre independence Education in Inndia.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
master seminar digital applications in india
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Renaissance Architecture: A Journey from Faith to Humanism
Pharma ospi slides which help in ospi learning
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Lesson notes of climatology university.
Insiders guide to clinical Medicine.pdf
Classroom Observation Tools for Teachers
Basic Mud Logging Guide for educational purpose
Cell Types and Its function , kingdom of life
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Cell Structure & Organelles in detailed.
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
2.FourierTransform-ShortQuestionswithAnswers.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Pre independence Education in Inndia.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Supply Chain Operations Speaking Notes -ICLT Program
master seminar digital applications in india
102 student loan defaulters named and shamed – Is someone you know on the list?
human mycosis Human fungal infections are called human mycosis..pptx

Css starting

  • 1. What is Css ?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles are normally stored in Style Sheets  Styles were added to HTML 4.0 to solve a problem  External Style Sheets can save you a lot of work  External Style Sheets are stored in CSS files  Multiple style definitions will cascade into one
  • 2. Basic Syntax  The CSS syntax is made up of three parts: a selector, a property and a value: selector {property: value}  The property and value are separated by a colon, and surrounded by curly braces: body {color: black}  more than one property, you must separate each property with a semicolon. p {text-align:center;color:red} For more readable format syntax like p { text-align: center; color: black; font-family: arial }
  • 3. Basic Syntax…  Grouping : You can group selectors. Separate each selector with a comma. Example : h1,h2,h3,h4,h5,h6 { color: green }  The class Selector : With the class selector you can define different styles for the same type of HTML element.
  • 4. How to Insert a Style Sheet  When a browser reads a style sheet, it will format the document according to it. There are three ways of inserting a style sheet:  (1) External Style Sheet  (2) Internal Style Sheet  (3) Multiple Style Sheets
  • 5. External Style Sheet  An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. Each page must link to the style sheet using the <link> tag. The <link> tag goes inside the head section:
  • 6. Internal Style Sheet  An internal style sheet should be used when a single document has a unique style. You define internal styles in the head section by using the <style> tag, like this:
  • 7. Multiple Style Sheets  If some properties have been set for the same selector in different style sheets, the values will be inherited from the more specific style sheet.
  • 8. Background Image, Color… Color : Bgimage : <head> <style type="text/css"> body {background-color: yellow} h1 {background-color: #00ff00} h2 {background-color: transparent} p {background-color: rgb(250,0,255)} </style> <head> </head> <style type="text/css"> body { background-image: url('bgdesert.jpg') } </style> <body> </head> <h1>This is header 1</h1> <h2>This is header 2</h2> <p>This is a paragraph</p> <body> </body> </body>
  • 10. Text Style (1)Color: <html> <head> <style type="text/css"> h1 {color: #00ff00} h2 {color: #dda0dd} p {color: rgb(0,0,255)} </style> </head> (2) Alignment: <html> <head> <style type="text/css"> h1 {text-align: center} h2 {text-align: left} h3 {text-align: right} </style> </head> (3) Control text: <html> <head> <style type="text/css"> p.uppercase {text-transform: uppercase} p.lowercase {text-transform: lowercase} p.capitalize {text-transform: capitalize} </style> </head> <body> <p class="uppercase">This is Text</p> <body> <body> <h1>This is header 1</h1> <h1>This is header 1</h1> <h2>This is header 2</h2> <p class="lowercase">This is Text</p> <h2>This is header 2</h2> <h3>This is header 3</h3> <p class="capitalize">This is Text</p> <p>This is a paragraph</p> </body> </body> </body> </html> </html> </html>
  • 11. Font Style (1)Font Family : <html> <head> <style type="text/css"> h3 {font-family: times} p {font-family: courier} p.sansserif {font-family: sans-serif} </style> </head> <body> <h3>This is header 3</h3> <p>This is a paragraph</p> <p class="sansserif">This is a paragraph</p> </body> </html> (2) Font property one Declaration <html> <head> <style type="text/css"> p { font: italic small-caps 900 12px arial } </style> </head> <body> <p>This is a paragraph</p> </body> </html>
  • 12. Border Style (1) Simple Border (2) Borders on each side <html> <head> <style type="text/css"> p { border: medium double rgb(250,0,255) } </style> </head> <html> <head> <style type="text/css"> p.soliddouble {border-style: solid double} p.doublesolid {border-style: double solid} p.groovedouble {border-style: groove double} p.three {border-style: solid double groove} </style> </head> <body> <p>Some text</p> </body> <body> <p class="soliddouble">Some text</p> <p class="doublesolid">Some text</p> <p class="groovedouble">Some text</p> <p class="three">Some text</p> </body> </html> </html>
  • 13. Margin Style (1) Simple Margin <html> <head> <style type="text/css"> p.margin {margin: 2cm 4cm 3cm 4cm} </style> </head> <body> <p>This is a paragraph with no specified margins</p> <p class="margin">This is a paragraph with specified margins</p> <p>This is a paragraph with no specified margins</p> </body> </html>
  • 14. Padding Style (1) Simple Padding <html> <head> <style type="text/css"> td {padding-top: 2cm} </style> </head> <body> <table border="1"> <tr> <td> This is a tablecell with a top padding </td> </tr> </table> </body> </html>
  • 15. List Style <html> <head> <style type="text/css"> ul.disc {list-style-type: disc} ul.circle {list-style-type: circle} ul.square {list-style-type: square} ul.none {list-style-type: none} </style> </head> <body> <ul class="disc"> <li>Coffee</li> <li>Tea</li> <li>Coca Cola</li> </ul> <ul class="circle"> <li>Coffee</li> <li>Tea</li> <li>Coca Cola</li> </ul> <ul class="square"> <li>Coffee</li> <li>Tea</li> <li>Coca Cola</li> For Ordered List </ul> <ul class="none"> <li>Coffee</li> <li>Tea</li> <li>Coca Cola</li> </ul> </body> </html> <style type="text/css"> ol.decimal {list-style-type: decimal} ol.lroman {list-style-type: lower-roman} ol.uroman {list-style-type: upper-roman} ol.lalpha {list-style-type: lower-alpha} ol.ualpha {list-style-type: upper-alpha} </style>