SlideShare a Scribd company logo
1 of 21
Download to read offline
Cascading Style Sheets (CSS)
Introduction with sample basic projects
Satish Shende
satish.sixteen@gmail.com
What is CSS?
CSS stands for
Cascading Style Sheet.
Typical CSS file is a text
file with an extension .css
and contains a series of
commands or rules.
These rules tell the
HTML how to display
/* Styles for sitename.com*/
body {
font-family:Arial;
background: #000;
}
#container {
text-align:left;
width:1020px;
}
#header {
height:232px;
}
#footer {
width: 100%;
padding: 0 10px;
margin-bottom: 10px;
}
And so on….
CSS Benefits
• Separates structure from presentation
• Provides advanced control of presentation
• Easy maintenance of multiple pages
• Faster page loading
• Better accessibility for disabled users
HTML without CSS is
like a
piece of candy
without a
pretty wrapper
HTML & CSS
• HTML and CSS work together to produce
beautiful and functional Web sites
• HTML = structure
• CSS = style
Attaching a Style Sheet
Attach a style sheet to a page by adding the code to the <head>
section of the HTML page.
There are 3 waysto attach CSS to a page:
1. External Style Sheet:
Best used to control styling on multiple pages.
<link rel="stylesheet" type="text/css"
media="all" href="css/styles.css" />
2. Internal Style Sheet: Best used to control styling on one page.
<style type=“text/css”>
h1 {color: red)
</style>
3. Inline Style Sheet*: CSS is not attached in the <header> but is used
directly within HTML tags.
<p style=“color: red”>Some Text</p>
Properties and Values
body {background: purple;}
h1 {color: green; }
h2 {font-size: large;}
p {color: #ff0000;}
Typical Web Page (HTML)
<div id=“container”>
<div id=“header”>Insert Title</div>
<div id=“main">content
<div id=“menu”>content</div>
</div>
<div id=“footer”>content</div>
</div>
Typical Web Page (CSS)
#container{property: value;}
#menu{property: value;}
#main{property: value;}
#footer{property: value;}
IDs and Classes
• IDs (#)are unique and can only be used once on the page
• Classes (.)can be used as many times as needed
HTML Code:
<h1
id=“mainHeading”>Names</h1>
<p class=“name”>Joe</p>
CSS Code:
#mainHeading{color: green}
.name{color: red}
Text Properties
.mainHeading {
color: red;
letter-spacing: 5px;
text-transform: uppercase;
word-spacing: 15px;
text-align: left;
font-family: Times;
text-decoration: underline;
font-size: 12px;
font-style: italic;
font-weight: bold;
}
To style the main heading in
the paragraph above, we assigned
a class the HTML tag.
<h3 class=“mainHeading”>Main Heading</h3>
Layering
Background colors and images are layered like sheets
of paper one on top of the other.
#bg {background:url(leaves.jpg) no-repeat topleft}
#main {background-color: red}
#box {background-color: yellow}
Background-Image
li {
background-image:url(flower.jpg);
padding-left: 10px;
}
<!DOCTYPE html>
<html>
<head>
<style>
p {
border: 1px solid powderblue;
padding: 30px;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
p {
text-align: center;
color: red;
}
</style>
</head>
<body>
<p>Every paragraph will be affected by the style.</p>
<p id="para1">Me too!</p>
<p>And me!</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: yellow;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
<p>This page has a light blue background
color!</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-image: url("paper.gif");
}
</style>
</head>
<body>
<h1>Hello World!</h1>
<p>This page has an image as the background!</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
p {
border-style: solid;
border-left-color: red;
border-right-color: blue;
border-top-color: green;
border-bottom-color: black;
}
</style>
</head>
<body>
<p>Satara is a city located in the Satara District of Maharashtra state of India,
near the confluence of the river Krishna and its tributary river Venna</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
ol {
background: #ff9999;
padding: 20px;
}
ol li {
background: #ffe5e5;
padding: 5px;
margin-left: 35px;
}
</style>
</head>
<body>
<h1>Styling Lists With Colors:</h1>
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Coca Cola</li>
</ol>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 320px;
padding: 10px;
border: 5px solid gray;
margin: 0;
}
</style>
</head>
<body>
<h2>Calculate the total width:</h2>
<img src="8nr4.gif" width="350" height="263" alt="Klematis">
<div>The picture above is 350px wide. The total width of this element is also
350px.</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
background-color: lightgreen;
}
@media only screen and (max-width: 600px) {
body {
background-color: lightblue;
}
}
</style>
</head>
<body>
<p>Resize the browser window. When the width of this document is 600 pixels or less,
the background-color is "lightblue", otherwise it is "lightgreen".</p>
</body>
</html>

More Related Content

What's hot (20)

Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheet
 
TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0
 
uptu web technology unit 2 Css
uptu web technology unit 2 Cssuptu web technology unit 2 Css
uptu web technology unit 2 Css
 
HTML CSS Basics
HTML CSS BasicsHTML CSS Basics
HTML CSS Basics
 
Ict 8 css
Ict 8 cssIct 8 css
Ict 8 css
 
Css
CssCss
Css
 
CSS
CSSCSS
CSS
 
Html Styles-CSS
Html Styles-CSSHtml Styles-CSS
Html Styles-CSS
 
Cascading style-sheet-
Cascading style-sheet-Cascading style-sheet-
Cascading style-sheet-
 
uptu web technology unit 2 Css
uptu web technology unit 2 Cssuptu web technology unit 2 Css
uptu web technology unit 2 Css
 
Cascading style sheet
Cascading style sheetCascading style sheet
Cascading style sheet
 
Turorial css
Turorial cssTurorial css
Turorial css
 
Css
CssCss
Css
 
Html cia
Html ciaHtml cia
Html cia
 
David Weliver
David WeliverDavid Weliver
David Weliver
 
Introduction to css part1
Introduction to css part1Introduction to css part1
Introduction to css part1
 
Web dev
Web devWeb dev
Web dev
 
Introducing Cascading Style Sheets
Introducing Cascading Style SheetsIntroducing Cascading Style Sheets
Introducing Cascading Style Sheets
 
1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introduction
 
uptu web technology unit 2 html
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 html
 

Similar to Css presentation introdution with sample basic projects

Similar to Css presentation introdution with sample basic projects (20)

CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
Css tutorial
Css tutorialCss tutorial
Css tutorial
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Make Css easy : easy tips for css
Make Css easy : easy tips for cssMake Css easy : easy tips for css
Make Css easy : easy tips for css
 
Introduction to css by programmerblog.net
Introduction to css by programmerblog.netIntroduction to css by programmerblog.net
Introduction to css by programmerblog.net
 
WT CSS
WT  CSSWT  CSS
WT CSS
 
css1.ppt
css1.pptcss1.ppt
css1.ppt
 
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.pptwaxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
 
Css1
Css1Css1
Css1
 
Basics of Cascading Style sheets
Basics of Cascading Style sheetsBasics of Cascading Style sheets
Basics of Cascading Style sheets
 
html-css
html-csshtml-css
html-css
 
CSS
CSSCSS
CSS
 
CSS
CSSCSS
CSS
 
Css tips & tricks
Css tips & tricksCss tips & tricks
Css tips & tricks
 
Web app development_html_css_03
Web app development_html_css_03Web app development_html_css_03
Web app development_html_css_03
 
CSS notes
CSS notesCSS notes
CSS notes
 
CSS
CSSCSS
CSS
 
Chapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssChapter 4a cascade style sheet css
Chapter 4a cascade style sheet css
 

More from Digital Shende

Mastering Digital Marketing: Unlocking Success with The POEM Frameworks
Mastering Digital Marketing: Unlocking Success with The POEM FrameworksMastering Digital Marketing: Unlocking Success with The POEM Frameworks
Mastering Digital Marketing: Unlocking Success with The POEM FrameworksDigital Shende
 
Digital Marketing for Women's Self-Help group
Digital Marketing for Women's Self-Help group Digital Marketing for Women's Self-Help group
Digital Marketing for Women's Self-Help group Digital Shende
 
How to Set Up a Google Ads Account Without a Campaign.pptx
How to Set Up a Google Ads Account Without a Campaign.pptxHow to Set Up a Google Ads Account Without a Campaign.pptx
How to Set Up a Google Ads Account Without a Campaign.pptxDigital Shende
 
Introduction to google certified educator level 1
Introduction to google certified educator level 1Introduction to google certified educator level 1
Introduction to google certified educator level 1Digital Shende
 
Build your own google site explation in marathi
Build your own google site explation in marathi Build your own google site explation in marathi
Build your own google site explation in marathi Digital Shende
 
Digital marketing overview 2021
Digital marketing overview 2021Digital marketing overview 2021
Digital marketing overview 2021Digital Shende
 
Digital Shende (Satish Shende) Visual Profile
Digital Shende (Satish Shende) Visual ProfileDigital Shende (Satish Shende) Visual Profile
Digital Shende (Satish Shende) Visual ProfileDigital Shende
 
Satish Shende, Satara Profile
Satish Shende, Satara ProfileSatish Shende, Satara Profile
Satish Shende, Satara ProfileDigital Shende
 
Highlights from the 7th Google for India event
Highlights from the 7th Google for India eventHighlights from the 7th Google for India event
Highlights from the 7th Google for India eventDigital Shende
 
Elements – App Screenshots
Elements – App ScreenshotsElements – App Screenshots
Elements – App ScreenshotsDigital Shende
 
Aarogya setu application
Aarogya setu applicationAarogya setu application
Aarogya setu applicationDigital Shende
 
Corona kavach app Beta Version Screenshots
Corona kavach app Beta Version ScreenshotsCorona kavach app Beta Version Screenshots
Corona kavach app Beta Version ScreenshotsDigital Shende
 
Content Creation Tools
Content Creation ToolsContent Creation Tools
Content Creation ToolsDigital Shende
 
Entrepreneurial Opportunities in Digital Marketing
Entrepreneurial Opportunities in Digital MarketingEntrepreneurial Opportunities in Digital Marketing
Entrepreneurial Opportunities in Digital MarketingDigital Shende
 
Vertical scrolling Screen mit app inventor
Vertical scrolling Screen mit app inventorVertical scrolling Screen mit app inventor
Vertical scrolling Screen mit app inventorDigital Shende
 
Tennis game with score mit app inventor code with design
Tennis game  with score mit app inventor code with designTennis game  with score mit app inventor code with design
Tennis game with score mit app inventor code with designDigital Shende
 
Rocket space game mit app inventor code with design
Rocket space game mit app inventor code with designRocket space game mit app inventor code with design
Rocket space game mit app inventor code with designDigital Shende
 
Germs kill mit app inventor game code with design
Germs kill mit app inventor game code with designGerms kill mit app inventor game code with design
Germs kill mit app inventor game code with designDigital Shende
 
Spinner Game MIT app inventor
Spinner Game MIT app inventorSpinner Game MIT app inventor
Spinner Game MIT app inventorDigital Shende
 
Mars mission 2020 registration
Mars mission 2020 registrationMars mission 2020 registration
Mars mission 2020 registrationDigital Shende
 

More from Digital Shende (20)

Mastering Digital Marketing: Unlocking Success with The POEM Frameworks
Mastering Digital Marketing: Unlocking Success with The POEM FrameworksMastering Digital Marketing: Unlocking Success with The POEM Frameworks
Mastering Digital Marketing: Unlocking Success with The POEM Frameworks
 
Digital Marketing for Women's Self-Help group
Digital Marketing for Women's Self-Help group Digital Marketing for Women's Self-Help group
Digital Marketing for Women's Self-Help group
 
How to Set Up a Google Ads Account Without a Campaign.pptx
How to Set Up a Google Ads Account Without a Campaign.pptxHow to Set Up a Google Ads Account Without a Campaign.pptx
How to Set Up a Google Ads Account Without a Campaign.pptx
 
Introduction to google certified educator level 1
Introduction to google certified educator level 1Introduction to google certified educator level 1
Introduction to google certified educator level 1
 
Build your own google site explation in marathi
Build your own google site explation in marathi Build your own google site explation in marathi
Build your own google site explation in marathi
 
Digital marketing overview 2021
Digital marketing overview 2021Digital marketing overview 2021
Digital marketing overview 2021
 
Digital Shende (Satish Shende) Visual Profile
Digital Shende (Satish Shende) Visual ProfileDigital Shende (Satish Shende) Visual Profile
Digital Shende (Satish Shende) Visual Profile
 
Satish Shende, Satara Profile
Satish Shende, Satara ProfileSatish Shende, Satara Profile
Satish Shende, Satara Profile
 
Highlights from the 7th Google for India event
Highlights from the 7th Google for India eventHighlights from the 7th Google for India event
Highlights from the 7th Google for India event
 
Elements – App Screenshots
Elements – App ScreenshotsElements – App Screenshots
Elements – App Screenshots
 
Aarogya setu application
Aarogya setu applicationAarogya setu application
Aarogya setu application
 
Corona kavach app Beta Version Screenshots
Corona kavach app Beta Version ScreenshotsCorona kavach app Beta Version Screenshots
Corona kavach app Beta Version Screenshots
 
Content Creation Tools
Content Creation ToolsContent Creation Tools
Content Creation Tools
 
Entrepreneurial Opportunities in Digital Marketing
Entrepreneurial Opportunities in Digital MarketingEntrepreneurial Opportunities in Digital Marketing
Entrepreneurial Opportunities in Digital Marketing
 
Vertical scrolling Screen mit app inventor
Vertical scrolling Screen mit app inventorVertical scrolling Screen mit app inventor
Vertical scrolling Screen mit app inventor
 
Tennis game with score mit app inventor code with design
Tennis game  with score mit app inventor code with designTennis game  with score mit app inventor code with design
Tennis game with score mit app inventor code with design
 
Rocket space game mit app inventor code with design
Rocket space game mit app inventor code with designRocket space game mit app inventor code with design
Rocket space game mit app inventor code with design
 
Germs kill mit app inventor game code with design
Germs kill mit app inventor game code with designGerms kill mit app inventor game code with design
Germs kill mit app inventor game code with design
 
Spinner Game MIT app inventor
Spinner Game MIT app inventorSpinner Game MIT app inventor
Spinner Game MIT app inventor
 
Mars mission 2020 registration
Mars mission 2020 registrationMars mission 2020 registration
Mars mission 2020 registration
 

Recently uploaded

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 

Recently uploaded (20)

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 

Css presentation introdution with sample basic projects

  • 1. Cascading Style Sheets (CSS) Introduction with sample basic projects Satish Shende satish.sixteen@gmail.com
  • 2. What is CSS? CSS stands for Cascading Style Sheet. Typical CSS file is a text file with an extension .css and contains a series of commands or rules. These rules tell the HTML how to display /* Styles for sitename.com*/ body { font-family:Arial; background: #000; } #container { text-align:left; width:1020px; } #header { height:232px; } #footer { width: 100%; padding: 0 10px; margin-bottom: 10px; } And so on….
  • 3. CSS Benefits • Separates structure from presentation • Provides advanced control of presentation • Easy maintenance of multiple pages • Faster page loading • Better accessibility for disabled users
  • 4. HTML without CSS is like a piece of candy without a pretty wrapper
  • 5. HTML & CSS • HTML and CSS work together to produce beautiful and functional Web sites • HTML = structure • CSS = style
  • 6. Attaching a Style Sheet Attach a style sheet to a page by adding the code to the <head> section of the HTML page. There are 3 waysto attach CSS to a page: 1. External Style Sheet: Best used to control styling on multiple pages. <link rel="stylesheet" type="text/css" media="all" href="css/styles.css" /> 2. Internal Style Sheet: Best used to control styling on one page. <style type=“text/css”> h1 {color: red) </style> 3. Inline Style Sheet*: CSS is not attached in the <header> but is used directly within HTML tags. <p style=“color: red”>Some Text</p>
  • 7. Properties and Values body {background: purple;} h1 {color: green; } h2 {font-size: large;} p {color: #ff0000;}
  • 8. Typical Web Page (HTML) <div id=“container”> <div id=“header”>Insert Title</div> <div id=“main">content <div id=“menu”>content</div> </div> <div id=“footer”>content</div> </div>
  • 9. Typical Web Page (CSS) #container{property: value;} #menu{property: value;} #main{property: value;} #footer{property: value;}
  • 10. IDs and Classes • IDs (#)are unique and can only be used once on the page • Classes (.)can be used as many times as needed HTML Code: <h1 id=“mainHeading”>Names</h1> <p class=“name”>Joe</p> CSS Code: #mainHeading{color: green} .name{color: red}
  • 11. Text Properties .mainHeading { color: red; letter-spacing: 5px; text-transform: uppercase; word-spacing: 15px; text-align: left; font-family: Times; text-decoration: underline; font-size: 12px; font-style: italic; font-weight: bold; } To style the main heading in the paragraph above, we assigned a class the HTML tag. <h3 class=“mainHeading”>Main Heading</h3>
  • 12. Layering Background colors and images are layered like sheets of paper one on top of the other. #bg {background:url(leaves.jpg) no-repeat topleft} #main {background-color: red} #box {background-color: yellow}
  • 14. <!DOCTYPE html> <html> <head> <style> p { border: 1px solid powderblue; padding: 30px; } </style> </head> <body> <h1>This is a heading</h1> <p>This is a paragraph.</p> <p>This is a paragraph.</p> <p>This is a paragraph.</p> </body> </html>
  • 15. <!DOCTYPE html> <html> <head> <style> p { text-align: center; color: red; } </style> </head> <body> <p>Every paragraph will be affected by the style.</p> <p id="para1">Me too!</p> <p>And me!</p> </body> </html>
  • 16. <!DOCTYPE html> <html> <head> <style> body { background-color: yellow; } </style> </head> <body> <h1>Hello World!</h1> <p>This page has a light blue background color!</p> </body> </html>
  • 17. <!DOCTYPE html> <html> <head> <style> body { background-image: url("paper.gif"); } </style> </head> <body> <h1>Hello World!</h1> <p>This page has an image as the background!</p> </body> </html>
  • 18. <!DOCTYPE html> <html> <head> <style> p { border-style: solid; border-left-color: red; border-right-color: blue; border-top-color: green; border-bottom-color: black; } </style> </head> <body> <p>Satara is a city located in the Satara District of Maharashtra state of India, near the confluence of the river Krishna and its tributary river Venna</p> </body> </html>
  • 19. <!DOCTYPE html> <html> <head> <style> ol { background: #ff9999; padding: 20px; } ol li { background: #ffe5e5; padding: 5px; margin-left: 35px; } </style> </head> <body> <h1>Styling Lists With Colors:</h1> <ol> <li>Coffee</li> <li>Tea</li> <li>Coca Cola</li> </ol> </body> </html>
  • 20. <!DOCTYPE html> <html> <head> <style> div { width: 320px; padding: 10px; border: 5px solid gray; margin: 0; } </style> </head> <body> <h2>Calculate the total width:</h2> <img src="8nr4.gif" width="350" height="263" alt="Klematis"> <div>The picture above is 350px wide. The total width of this element is also 350px.</div> </body> </html>
  • 21. <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> body { background-color: lightgreen; } @media only screen and (max-width: 600px) { body { background-color: lightblue; } } </style> </head> <body> <p>Resize the browser window. When the width of this document is 600 pixels or less, the background-color is "lightblue", otherwise it is "lightgreen".</p> </body> </html>