際際滷

際際滷Share a Scribd company logo
By Super Coder
Cascading Style Sheet (CSS)
Tutorial
Topics

Introduction

Syntax

Selector

Using CSS in HTML Pages

CSS Rules

CSS Fonts

CSS Text Formating

CSS Box Model

CSS Backgrounds

CSS Normal and Beyond Flow

CSS Positioning
Introduction
Cascading Style Sheets (CSS) Applies to HTML
Pages For Designing the Layout and View
Appearance of Your Website.
A styled HTML document
produced by the CSS
body { background: yellow; }
p { color: red;font-size: 20px; }
Color Font
Using Css
Color
Background
Introduction
Complete Example
<!DOCTYPE html>
<html>
<head>
<title>CSS Style</title>
<style type="text/css">
body { background: yellow; }
p { color: red;font-size: 20px; }
</style>
</head>
<body>
<p>Hello World</p>
</body>
</html>
Opening CSS Styles
CSS Property name
CSS Property Value
CSS Selector
Closing CSS Stylesheet
CSS Syntax
CSS Properties and Values Syntax For Selecting HTML
Element
p {
font-size: 20px ;
background:red;
}
Css Properties
Values
Closing Braces all Propety
Values of p Enclosed insides
Braces
Opening Braces
HTML Paragraph
CSS Selector
CSS Properties
Names
CSS Syntax
css selector { property-name:values }
Css Selector - HTML Dom Elements Selecting By Elements
Tag,Class name or By id.
Property-name : background , font-size , color , text-alignment etc.
Property -values : orange , 17px, center, etc.
CSS Syntax
CSS Selector Syntax HTML Elements Which Selected By CSS
Only Select li element which parent is ul
<h1>Hello H1<h1><h2>Hello H2<h2><h3>Hello H3<h3>
<p>Hello World! I Select All p Tag Elements</p>
Multi Element Type  h1,h2,h3 { background : orange }
Single Element Type - p { color:red; }
All Element Type - * { padding:5px; } <p>selected me</p> <h2>Selected me</p>
Element By id ( # ) - #p1 , #p2 { marging:5px } <p id=p1>paragraph1</p><p id=p2>paragraph2</p>
Element By Class ( . )- .p1,.h1 { color :seagreen; } <p class=p1>Class p1</p><h1 class=h1>Heading
1</h1>
Element with class  p.p1 { font-style:italic; } <p class=p1>Only Select me</p><p class=p2>Not Select me</p>
Descendents Selector  ul li { color : green; } <ul><li>select me</li><li>select me</li></ul>
Using CSS in HTML Pages
We Can Use CSS in HTML Pages in 3 ways: -
 Inline css
E.g
 Internal CSS
E.g
<p style=color:red>I am a inline CSS Style Paragaraph Tag</p>
<html>
<head>
<style> p { color:red; } </style>
<!----Internal CSS--->
</head>
<body>
<p> My Color Changed By Internal CSS</p>
</body>
</html>
Using CSS in HTML Pages
 External CSS
<html>
<head>
<link rel=stylesheet
href=style.css>
<!---Linking External CSS Using
href-->
</head>
<body>
<p>My Style Changed By External
CSS style.css</p>
</body>
</html>
style.css
-----------------------------------------------------
p{color:red;}
h1{color:blue;}
As a Developer i Not Prefered To Using Inline
CSS .use minimum inline CSS Try to Use CSS
Externally or Internally Because managing all
element style easy.
You think what you like to edit?
100 time paragraph tag style?
Or
Just 1 change in External CSS
CSS Rules
Now What happened If Multiple Style Comes To Same
Elements ?
 E.g : - in Internal i add
p{ color :red; }
 And in External I add
p{ color:black;}
Then Here is a Some Rules Which we See How It Works And Whom It
Select.
CSS Rules
 Important ( <p style=color:red!important>Important</p>)
This always Comes First when we Selecting Element whether any
internal external or inline css added important works first.
 Inline css (we already see inline css above)
This comes in Second Position.
 Now Inline and External Had Some Different Case.
Rule with selector :
1. ID
2. class
3. descendant/element type
4. universal
5. HTML attribute
This Rules Followed By Internal and
External but Internal Always Comes First
Then External
CSS Fonts
 CSS font is Very important part of CSS for Customizing Fonts
in Our Webpage. We Can Customize this fonts using Css.
 Change Font Weight
 Change Color
 Change line height (line gap between paragraph)
 Change Font Size
 Font Style
CSS Fonts
Example: -
<!DOCTYPE html>
<html>
<head>
<title>CSS Style</title>
<style type="text/css">
#p1 { color: red;font-size: 20px; }
#p2{ font-family: sans-serif; line-height: 40px; }
#p3{ font-style: italic;font-weight: 600; }
</style>
</head>
<body>
<p id="p1">I am p1 text with css font property color red and font size 20px </p>
<p id="p2">I am p2 text with css font property font family sans-serif and line height 20px</p>
<p id="p3">I am p3 with css property font style italic and font weight 600</p>
</body>
</html>
CSS Fonts
Font Color Red
Line Height is 40px
Font Style is Italic
Font Size is 20px
Font family Sans-serif
Font Weight is 600
Is likely to Bold text
CSS Text
We Used CSS Text To Color, align, transform etc
with text.
Like Aligning Text to Center
Change Letter To UpperCase
Change Color of Text and Much More.
CSS Text
Lets See Some Property and its Values of CSS Text.

color  which is used to change color of text. Values like (white,red,#FFF(Hexacolor)).

text-align : - used for aligning text values Like (left,right,center,justify).

text-decoration : - used for decorating text Values like (underline,overline,line-through).

text-transform : - used for changing case values like (uppercase,lowercase,capitalize).

text-indent : - used for left some space before start paragraph value is in px (0px,10px...).

letter-spacing : - used for adjust space between letters values in px (0px,10px...).

line-height : used for adjust line between text value in unit (1.2 ,1.5 ,2.... ).

direction  used to change direction of text value like (rtl)

word-spacing : - adjust space between words value in px like ( 10px,15px ...)

text-shadow : text shadow contain multi values for adjusting shadow and color see in e.g.
CSS Text
Example Code :
<!DOCTYPE html>
<html>
<head>
<title>CSS Text</title>
<style type="text/css">
#p1{ color:red; }
#p2{ text-align: center; }
#p3{ text-decoration: underline; }
#p4 { text-transform: uppercase; }
#p5 { text-indent: 50px; }
#p6{ letter-spacing: 20px; }
#p7 { line-height: 1.5; }
#p8 { direction: rtl; }
#p9{ word-spacing: 10px; }
#p10 { text-shadow: 3px 2px red; }
</style>
</head>
<body>
<p id="p1">Red Color Text</p>
<p id="p2">Center Align Text</p>
<p id="p3">Decorated Text like Underline</p>
<p id="p4">Transform To Uppercase</p>
<p id="p5">Text Indent which left some margin on beginning of first line</p>
<p id="p6">This is Line of paragraph with space of letter is 20px </p>
<p id="p7">This is Text which i increase line height and break <br>for line breaking to understand that height is <br>increase between paragraph</p>
<p id="p8">This is Text which direction is change</p>
<p id="p9">This is paragraph which word spacing is different then other paragraph words</p>
<p id="p10">This is a line of paragraph which had a shadow effect on text</p>
</body>
</html>
CSS Text
Color
Decorated Text
This is Text indent
Line height increased
Align Text
Letter Spacing u see
Direction Changed
Word Space increased
Multi value used for
Shadow and color
CSS Box Model
All elements in HTML can be considered as boxes. In
CSS, the term "box model" is used when talking about
design and layout.
Css BOX Model is Wraps HTML elements.It consists
of: margins, borders, padding, and the content.
CSS Box Model
Margin
Border
Padding
Body Contents Come Here
CSS BOX Model Example
<!DOCTYPE html>
<html>
<head>
<title>Box Model</title>
<style type="text/css">
body{
padding: 10px;
background: red;
}
#box{
margin: 20px;
padding: 20px;
border:10px solid yellow;
}
</style>
</head>
<body>
<div id="box">
<p>I m inside a box Model</p>
</div>
</body>
</html>
CSS Box Model Example
 Result in Simple.  Result Displaying All Layers.
BODYBODY MarginMargin
BorderBorder PaddingPadding
MarginMargin
PaddingPadding
BorderBorder
BODYBODY
CSS Basics

More Related Content

What's hot (20)

CSS Basics
CSS BasicsCSS Basics
CSS Basics
WordPress Memphis
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
Evolution Network
Css
CssCss
Css
Hemant Saini
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
Mario Hernandez
HTML and CSS crash course!
HTML and CSS crash course!HTML and CSS crash course!
HTML and CSS crash course!
Ana Cidre
Cascading style sheets (CSS)
Cascading style sheets (CSS)Cascading style sheets (CSS)
Cascading style sheets (CSS)
Harshita Yadav
HTML CSS & Javascript
HTML CSS & JavascriptHTML CSS & Javascript
HTML CSS & Javascript
David Lindkvist
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS Presentation
Shawn Calvert
Html text and formatting
Html text and formattingHtml text and formatting
Html text and formatting
eShikshak
CSS for Beginners
CSS for BeginnersCSS for Beginners
CSS for Beginners
Amit Kumar Singh
Css
CssCss
Css
veena parihar
JavaScript: Events Handling
JavaScript: Events HandlingJavaScript: Events Handling
JavaScript: Events Handling
Yuriy Bezgachnyuk
CSS
CSSCSS
CSS
seedinteractive
Html basics
Html basicsHtml basics
Html basics
mcatahir947
Bootstrap PPT by Mukesh
Bootstrap PPT by MukeshBootstrap PPT by Mukesh
Bootstrap PPT by Mukesh
Mukesh Kumar
JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)
WebStackAcademy
Css
CssCss
Css
Manav Prasad
Web design - Working with Links and Images
Web design - Working with Links and ImagesWeb design - Working with Links and Images
Web design - Working with Links and Images
Mustafa Kamel Mohammadi
Style and Selector
Style and SelectorStyle and Selector
Style and Selector
Yaowaluck Promdee
Html
HtmlHtml
Html
Nandakumar Ganapathy

Similar to CSS Basics (20)

Css1
Css1Css1
Css1
Vadim Spiridenko
css1.ppt
css1.pptcss1.ppt
css1.ppt
BalasundaramSr
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.pptwaxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
Ismaciil2
Unitegergergegegegetgegegegegegeg-2-CSS.pptx
Unitegergergegegegetgegegegegegeg-2-CSS.pptxUnitegergergegegegetgegegegegegeg-2-CSS.pptx
Unitegergergegegegetgegegegegegeg-2-CSS.pptx
VikasTuwar1
Lect-6cvxvxcvxcvxc xc cx cx x xc c c xc-CSS.pptx
Lect-6cvxvxcvxcvxc xc cx cx x xc c c xc-CSS.pptxLect-6cvxvxcvxcvxc xc cx cx x xc c c xc-CSS.pptx
Lect-6cvxvxcvxcvxc xc cx cx x xc c c xc-CSS.pptx
Anwar Patel
CSS ppt of cascading Style sheet for beginners.pptx
CSS ppt of cascading Style sheet for beginners.pptxCSS ppt of cascading Style sheet for beginners.pptx
CSS ppt of cascading Style sheet for beginners.pptx
HarshSahu509641
html-css
html-csshtml-css
html-css
Dhirendra Chauhan
CSS notes
CSS notesCSS notes
CSS notes
Rajendra Prasad
Chapter_1_Web_Technologies_Basics (CSS)_Part_2.pptx
Chapter_1_Web_Technologies_Basics (CSS)_Part_2.pptxChapter_1_Web_Technologies_Basics (CSS)_Part_2.pptx
Chapter_1_Web_Technologies_Basics (CSS)_Part_2.pptx
eyasu6
Turorial css
Turorial cssTurorial css
Turorial css
Muhammad Syifa
v5-introduction to html-css-210321161444.pptx
v5-introduction to html-css-210321161444.pptxv5-introduction to html-css-210321161444.pptx
v5-introduction to html-css-210321161444.pptx
hannahroseline2
v5-introduction to html-css-210321161444.pptx
v5-introduction to html-css-210321161444.pptxv5-introduction to html-css-210321161444.pptx
v5-introduction to html-css-210321161444.pptx
hannahroseline2
cse labpractical.ppt
cse labpractical.pptcse labpractical.ppt
cse labpractical.ppt
NividitaDarwai
Cascading style sheet
Cascading style sheetCascading style sheet
Cascading style sheet
VARSHAKUMARI49
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
Folasade Adedeji
Css1
Css1Css1
Css1
Pulkit Tanwar
CSS.pptx
CSS.pptxCSS.pptx
CSS.pptx
PushpaLatha551681
Css1
Css1Css1
Css1
Vadim Spiridenko
Fwd week2 tw-20120903
Fwd week2 tw-20120903Fwd week2 tw-20120903
Fwd week2 tw-20120903
TerryWeber
Cascading style sheet, CSS Box model, Table in CSS
Cascading style sheet, CSS Box model, Table in CSSCascading style sheet, CSS Box model, Table in CSS
Cascading style sheet, CSS Box model, Table in CSS
SherinRappai
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.pptwaxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
Ismaciil2
Unitegergergegegegetgegegegegegeg-2-CSS.pptx
Unitegergergegegegetgegegegegegeg-2-CSS.pptxUnitegergergegegegetgegegegegegeg-2-CSS.pptx
Unitegergergegegegetgegegegegegeg-2-CSS.pptx
VikasTuwar1
Lect-6cvxvxcvxcvxc xc cx cx x xc c c xc-CSS.pptx
Lect-6cvxvxcvxcvxc xc cx cx x xc c c xc-CSS.pptxLect-6cvxvxcvxcvxc xc cx cx x xc c c xc-CSS.pptx
Lect-6cvxvxcvxcvxc xc cx cx x xc c c xc-CSS.pptx
Anwar Patel
CSS ppt of cascading Style sheet for beginners.pptx
CSS ppt of cascading Style sheet for beginners.pptxCSS ppt of cascading Style sheet for beginners.pptx
CSS ppt of cascading Style sheet for beginners.pptx
HarshSahu509641
Chapter_1_Web_Technologies_Basics (CSS)_Part_2.pptx
Chapter_1_Web_Technologies_Basics (CSS)_Part_2.pptxChapter_1_Web_Technologies_Basics (CSS)_Part_2.pptx
Chapter_1_Web_Technologies_Basics (CSS)_Part_2.pptx
eyasu6
v5-introduction to html-css-210321161444.pptx
v5-introduction to html-css-210321161444.pptxv5-introduction to html-css-210321161444.pptx
v5-introduction to html-css-210321161444.pptx
hannahroseline2
v5-introduction to html-css-210321161444.pptx
v5-introduction to html-css-210321161444.pptxv5-introduction to html-css-210321161444.pptx
v5-introduction to html-css-210321161444.pptx
hannahroseline2
cse labpractical.ppt
cse labpractical.pptcse labpractical.ppt
cse labpractical.ppt
NividitaDarwai
Cascading style sheet
Cascading style sheetCascading style sheet
Cascading style sheet
VARSHAKUMARI49
Fwd week2 tw-20120903
Fwd week2 tw-20120903Fwd week2 tw-20120903
Fwd week2 tw-20120903
TerryWeber
Cascading style sheet, CSS Box model, Table in CSS
Cascading style sheet, CSS Box model, Table in CSSCascading style sheet, CSS Box model, Table in CSS
Cascading style sheet, CSS Box model, Table in CSS
SherinRappai

Recently uploaded (20)

Knownsense 2025 prelims- U-25 General Quiz.pdf
Knownsense 2025 prelims- U-25 General Quiz.pdfKnownsense 2025 prelims- U-25 General Quiz.pdf
Knownsense 2025 prelims- U-25 General Quiz.pdf
Pragya - UEM Kolkata Quiz Club
20250402 ACCA TeamScienceAIEra 20250402 v10.pptx
20250402 ACCA TeamScienceAIEra 20250402 v10.pptx20250402 ACCA TeamScienceAIEra 20250402 v10.pptx
20250402 ACCA TeamScienceAIEra 20250402 v10.pptx
home
General Quiz at Maharaja Agrasen College | Amlan Sarkar | Prelims with Answer...
General Quiz at Maharaja Agrasen College | Amlan Sarkar | Prelims with Answer...General Quiz at Maharaja Agrasen College | Amlan Sarkar | Prelims with Answer...
General Quiz at Maharaja Agrasen College | Amlan Sarkar | Prelims with Answer...
Amlan Sarkar
UTI Quinolones by Mrs. Manjushri Dabhade
UTI Quinolones by Mrs. Manjushri DabhadeUTI Quinolones by Mrs. Manjushri Dabhade
UTI Quinolones by Mrs. Manjushri Dabhade
Dabhade madam Dabhade
Antifungal agents by Mrs. Manjushri Dabhade
Antifungal agents by Mrs. Manjushri DabhadeAntifungal agents by Mrs. Manjushri Dabhade
Antifungal agents by Mrs. Manjushri Dabhade
Dabhade madam Dabhade
Anti-Viral Agents.pptx Medicinal Chemistry III, B Pharm SEM VI
Anti-Viral Agents.pptx Medicinal Chemistry III, B Pharm SEM VIAnti-Viral Agents.pptx Medicinal Chemistry III, B Pharm SEM VI
Anti-Viral Agents.pptx Medicinal Chemistry III, B Pharm SEM VI
Samruddhi Khonde
MIPLM subject matter expert Dr Robert Klinski
MIPLM subject matter expert Dr Robert KlinskiMIPLM subject matter expert Dr Robert Klinski
MIPLM subject matter expert Dr Robert Klinski
MIPLM
Unit 3: Combustion in Spark Ignition Engines
Unit 3: Combustion in Spark Ignition EnginesUnit 3: Combustion in Spark Ignition Engines
Unit 3: Combustion in Spark Ignition Engines
NileshKumbhar21
Different perspectives on dugout canoe heritage of Soomaa.pdf
Different perspectives on dugout canoe heritage of Soomaa.pdfDifferent perspectives on dugout canoe heritage of Soomaa.pdf
Different perspectives on dugout canoe heritage of Soomaa.pdf
Aivar Ruukel
Recruitment in the Odoo 17 - Odoo 17 際際滷s
Recruitment in the Odoo 17 - Odoo 17 際際滷sRecruitment in the Odoo 17 - Odoo 17 際際滷s
Recruitment in the Odoo 17 - Odoo 17 際際滷s
Celine George
Week 6 - EDL 290F - No Drop Ride (2025).pdf
Week 6 - EDL 290F - No Drop Ride (2025).pdfWeek 6 - EDL 290F - No Drop Ride (2025).pdf
Week 6 - EDL 290F - No Drop Ride (2025).pdf
Liz Walsh-Trevino
MIPLM subject matter expert Dr Alihan Kaya
MIPLM subject matter expert Dr Alihan KayaMIPLM subject matter expert Dr Alihan Kaya
MIPLM subject matter expert Dr Alihan Kaya
MIPLM
CLEFT LIP AND PALATE: NURSING MANAGEMENT.pptx
CLEFT LIP AND PALATE: NURSING MANAGEMENT.pptxCLEFT LIP AND PALATE: NURSING MANAGEMENT.pptx
CLEFT LIP AND PALATE: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷sHow to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
Celine George
Enhancing SoTL through Generative AI -- Opportunities and Ethical Considerati...
Enhancing SoTL through Generative AI -- Opportunities and Ethical Considerati...Enhancing SoTL through Generative AI -- Opportunities and Ethical Considerati...
Enhancing SoTL through Generative AI -- Opportunities and Ethical Considerati...
Sue Beckingham
The basics of sentences session 9pptx.pptx
The basics of sentences session 9pptx.pptxThe basics of sentences session 9pptx.pptx
The basics of sentences session 9pptx.pptx
heathfieldcps1
Introduction to Systematic Reviews - Prof Ejaz Khan
Introduction to Systematic Reviews - Prof Ejaz KhanIntroduction to Systematic Reviews - Prof Ejaz Khan
Introduction to Systematic Reviews - Prof Ejaz Khan
Systematic Reviews Network (SRN)
Managing Online Signature and Payment with Odoo 17
Managing Online Signature and Payment with Odoo 17Managing Online Signature and Payment with Odoo 17
Managing Online Signature and Payment with Odoo 17
Celine George
Knownsense 2025 Finals-U-25 General Quiz.pdf
Knownsense 2025 Finals-U-25 General Quiz.pdfKnownsense 2025 Finals-U-25 General Quiz.pdf
Knownsense 2025 Finals-U-25 General Quiz.pdf
Pragya - UEM Kolkata Quiz Club
20250402 ACCA TeamScienceAIEra 20250402 v10.pptx
20250402 ACCA TeamScienceAIEra 20250402 v10.pptx20250402 ACCA TeamScienceAIEra 20250402 v10.pptx
20250402 ACCA TeamScienceAIEra 20250402 v10.pptx
home
General Quiz at Maharaja Agrasen College | Amlan Sarkar | Prelims with Answer...
General Quiz at Maharaja Agrasen College | Amlan Sarkar | Prelims with Answer...General Quiz at Maharaja Agrasen College | Amlan Sarkar | Prelims with Answer...
General Quiz at Maharaja Agrasen College | Amlan Sarkar | Prelims with Answer...
Amlan Sarkar
UTI Quinolones by Mrs. Manjushri Dabhade
UTI Quinolones by Mrs. Manjushri DabhadeUTI Quinolones by Mrs. Manjushri Dabhade
UTI Quinolones by Mrs. Manjushri Dabhade
Dabhade madam Dabhade
Antifungal agents by Mrs. Manjushri Dabhade
Antifungal agents by Mrs. Manjushri DabhadeAntifungal agents by Mrs. Manjushri Dabhade
Antifungal agents by Mrs. Manjushri Dabhade
Dabhade madam Dabhade
Anti-Viral Agents.pptx Medicinal Chemistry III, B Pharm SEM VI
Anti-Viral Agents.pptx Medicinal Chemistry III, B Pharm SEM VIAnti-Viral Agents.pptx Medicinal Chemistry III, B Pharm SEM VI
Anti-Viral Agents.pptx Medicinal Chemistry III, B Pharm SEM VI
Samruddhi Khonde
MIPLM subject matter expert Dr Robert Klinski
MIPLM subject matter expert Dr Robert KlinskiMIPLM subject matter expert Dr Robert Klinski
MIPLM subject matter expert Dr Robert Klinski
MIPLM
Unit 3: Combustion in Spark Ignition Engines
Unit 3: Combustion in Spark Ignition EnginesUnit 3: Combustion in Spark Ignition Engines
Unit 3: Combustion in Spark Ignition Engines
NileshKumbhar21
Different perspectives on dugout canoe heritage of Soomaa.pdf
Different perspectives on dugout canoe heritage of Soomaa.pdfDifferent perspectives on dugout canoe heritage of Soomaa.pdf
Different perspectives on dugout canoe heritage of Soomaa.pdf
Aivar Ruukel
Recruitment in the Odoo 17 - Odoo 17 際際滷s
Recruitment in the Odoo 17 - Odoo 17 際際滷sRecruitment in the Odoo 17 - Odoo 17 際際滷s
Recruitment in the Odoo 17 - Odoo 17 際際滷s
Celine George
Week 6 - EDL 290F - No Drop Ride (2025).pdf
Week 6 - EDL 290F - No Drop Ride (2025).pdfWeek 6 - EDL 290F - No Drop Ride (2025).pdf
Week 6 - EDL 290F - No Drop Ride (2025).pdf
Liz Walsh-Trevino
MIPLM subject matter expert Dr Alihan Kaya
MIPLM subject matter expert Dr Alihan KayaMIPLM subject matter expert Dr Alihan Kaya
MIPLM subject matter expert Dr Alihan Kaya
MIPLM
CLEFT LIP AND PALATE: NURSING MANAGEMENT.pptx
CLEFT LIP AND PALATE: NURSING MANAGEMENT.pptxCLEFT LIP AND PALATE: NURSING MANAGEMENT.pptx
CLEFT LIP AND PALATE: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷sHow to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
Celine George
Enhancing SoTL through Generative AI -- Opportunities and Ethical Considerati...
Enhancing SoTL through Generative AI -- Opportunities and Ethical Considerati...Enhancing SoTL through Generative AI -- Opportunities and Ethical Considerati...
Enhancing SoTL through Generative AI -- Opportunities and Ethical Considerati...
Sue Beckingham
The basics of sentences session 9pptx.pptx
The basics of sentences session 9pptx.pptxThe basics of sentences session 9pptx.pptx
The basics of sentences session 9pptx.pptx
heathfieldcps1
Managing Online Signature and Payment with Odoo 17
Managing Online Signature and Payment with Odoo 17Managing Online Signature and Payment with Odoo 17
Managing Online Signature and Payment with Odoo 17
Celine George

CSS Basics

  • 1. By Super Coder Cascading Style Sheet (CSS) Tutorial
  • 2. Topics Introduction Syntax Selector Using CSS in HTML Pages CSS Rules CSS Fonts CSS Text Formating CSS Box Model CSS Backgrounds CSS Normal and Beyond Flow CSS Positioning
  • 3. Introduction Cascading Style Sheets (CSS) Applies to HTML Pages For Designing the Layout and View Appearance of Your Website. A styled HTML document produced by the CSS body { background: yellow; } p { color: red;font-size: 20px; } Color Font Using Css Color Background
  • 4. Introduction Complete Example <!DOCTYPE html> <html> <head> <title>CSS Style</title> <style type="text/css"> body { background: yellow; } p { color: red;font-size: 20px; } </style> </head> <body> <p>Hello World</p> </body> </html> Opening CSS Styles CSS Property name CSS Property Value CSS Selector Closing CSS Stylesheet
  • 5. CSS Syntax CSS Properties and Values Syntax For Selecting HTML Element p { font-size: 20px ; background:red; } Css Properties Values Closing Braces all Propety Values of p Enclosed insides Braces Opening Braces HTML Paragraph CSS Selector CSS Properties Names
  • 6. CSS Syntax css selector { property-name:values } Css Selector - HTML Dom Elements Selecting By Elements Tag,Class name or By id. Property-name : background , font-size , color , text-alignment etc. Property -values : orange , 17px, center, etc.
  • 7. CSS Syntax CSS Selector Syntax HTML Elements Which Selected By CSS Only Select li element which parent is ul <h1>Hello H1<h1><h2>Hello H2<h2><h3>Hello H3<h3> <p>Hello World! I Select All p Tag Elements</p> Multi Element Type h1,h2,h3 { background : orange } Single Element Type - p { color:red; } All Element Type - * { padding:5px; } <p>selected me</p> <h2>Selected me</p> Element By id ( # ) - #p1 , #p2 { marging:5px } <p id=p1>paragraph1</p><p id=p2>paragraph2</p> Element By Class ( . )- .p1,.h1 { color :seagreen; } <p class=p1>Class p1</p><h1 class=h1>Heading 1</h1> Element with class p.p1 { font-style:italic; } <p class=p1>Only Select me</p><p class=p2>Not Select me</p> Descendents Selector ul li { color : green; } <ul><li>select me</li><li>select me</li></ul>
  • 8. Using CSS in HTML Pages We Can Use CSS in HTML Pages in 3 ways: - Inline css E.g Internal CSS E.g <p style=color:red>I am a inline CSS Style Paragaraph Tag</p> <html> <head> <style> p { color:red; } </style> <!----Internal CSS---> </head> <body> <p> My Color Changed By Internal CSS</p> </body> </html>
  • 9. Using CSS in HTML Pages External CSS <html> <head> <link rel=stylesheet href=style.css> <!---Linking External CSS Using href--> </head> <body> <p>My Style Changed By External CSS style.css</p> </body> </html> style.css ----------------------------------------------------- p{color:red;} h1{color:blue;} As a Developer i Not Prefered To Using Inline CSS .use minimum inline CSS Try to Use CSS Externally or Internally Because managing all element style easy. You think what you like to edit? 100 time paragraph tag style? Or Just 1 change in External CSS
  • 10. CSS Rules Now What happened If Multiple Style Comes To Same Elements ? E.g : - in Internal i add p{ color :red; } And in External I add p{ color:black;} Then Here is a Some Rules Which we See How It Works And Whom It Select.
  • 11. CSS Rules Important ( <p style=color:red!important>Important</p>) This always Comes First when we Selecting Element whether any internal external or inline css added important works first. Inline css (we already see inline css above) This comes in Second Position. Now Inline and External Had Some Different Case. Rule with selector : 1. ID 2. class 3. descendant/element type 4. universal 5. HTML attribute This Rules Followed By Internal and External but Internal Always Comes First Then External
  • 12. CSS Fonts CSS font is Very important part of CSS for Customizing Fonts in Our Webpage. We Can Customize this fonts using Css. Change Font Weight Change Color Change line height (line gap between paragraph) Change Font Size Font Style
  • 13. CSS Fonts Example: - <!DOCTYPE html> <html> <head> <title>CSS Style</title> <style type="text/css"> #p1 { color: red;font-size: 20px; } #p2{ font-family: sans-serif; line-height: 40px; } #p3{ font-style: italic;font-weight: 600; } </style> </head> <body> <p id="p1">I am p1 text with css font property color red and font size 20px </p> <p id="p2">I am p2 text with css font property font family sans-serif and line height 20px</p> <p id="p3">I am p3 with css property font style italic and font weight 600</p> </body> </html>
  • 14. CSS Fonts Font Color Red Line Height is 40px Font Style is Italic Font Size is 20px Font family Sans-serif Font Weight is 600 Is likely to Bold text
  • 15. CSS Text We Used CSS Text To Color, align, transform etc with text. Like Aligning Text to Center Change Letter To UpperCase Change Color of Text and Much More.
  • 16. CSS Text Lets See Some Property and its Values of CSS Text. color which is used to change color of text. Values like (white,red,#FFF(Hexacolor)). text-align : - used for aligning text values Like (left,right,center,justify). text-decoration : - used for decorating text Values like (underline,overline,line-through). text-transform : - used for changing case values like (uppercase,lowercase,capitalize). text-indent : - used for left some space before start paragraph value is in px (0px,10px...). letter-spacing : - used for adjust space between letters values in px (0px,10px...). line-height : used for adjust line between text value in unit (1.2 ,1.5 ,2.... ). direction used to change direction of text value like (rtl) word-spacing : - adjust space between words value in px like ( 10px,15px ...) text-shadow : text shadow contain multi values for adjusting shadow and color see in e.g.
  • 17. CSS Text Example Code : <!DOCTYPE html> <html> <head> <title>CSS Text</title> <style type="text/css"> #p1{ color:red; } #p2{ text-align: center; } #p3{ text-decoration: underline; } #p4 { text-transform: uppercase; } #p5 { text-indent: 50px; } #p6{ letter-spacing: 20px; } #p7 { line-height: 1.5; } #p8 { direction: rtl; } #p9{ word-spacing: 10px; } #p10 { text-shadow: 3px 2px red; } </style> </head> <body> <p id="p1">Red Color Text</p> <p id="p2">Center Align Text</p> <p id="p3">Decorated Text like Underline</p> <p id="p4">Transform To Uppercase</p> <p id="p5">Text Indent which left some margin on beginning of first line</p> <p id="p6">This is Line of paragraph with space of letter is 20px </p> <p id="p7">This is Text which i increase line height and break <br>for line breaking to understand that height is <br>increase between paragraph</p> <p id="p8">This is Text which direction is change</p> <p id="p9">This is paragraph which word spacing is different then other paragraph words</p> <p id="p10">This is a line of paragraph which had a shadow effect on text</p> </body> </html>
  • 18. CSS Text Color Decorated Text This is Text indent Line height increased Align Text Letter Spacing u see Direction Changed Word Space increased Multi value used for Shadow and color
  • 19. CSS Box Model All elements in HTML can be considered as boxes. In CSS, the term "box model" is used when talking about design and layout. Css BOX Model is Wraps HTML elements.It consists of: margins, borders, padding, and the content.
  • 21. CSS BOX Model Example <!DOCTYPE html> <html> <head> <title>Box Model</title> <style type="text/css"> body{ padding: 10px; background: red; } #box{ margin: 20px; padding: 20px; border:10px solid yellow; } </style> </head> <body> <div id="box"> <p>I m inside a box Model</p> </div> </body> </html>
  • 22. CSS Box Model Example Result in Simple. Result Displaying All Layers. BODYBODY MarginMargin BorderBorder PaddingPadding MarginMargin PaddingPadding BorderBorder BODYBODY