SlideShare una empresa de Scribd logo
1 de 11
THE ART OF CSS
RAPHAEL WANJIKU
SOFTWARE DEVELOPER
raphael@incsyncweb.com
The Art of CSS
CSS allows separation of the HTML content from its styling.
It is responsible for the presentation(text formatting,colors,fonts,borders etc).
Applying CSS
Can be applied either:
i) internally- inline or within the same page holding the HTML content
<head>
<style type=”text/css”>
.....styles
</style>
</head>
ii) Externally- defined in a different file and then called withing the page holding
the HTML content.(called in the head of the page)
<head>
<link rel=”stylesheet” type=”text/css” href=”path to the css
file” />
OR use @import method
<style type=”text/css”>@import url(path to the css file”)</style>
</head>
Reasons for using external CSS:
a) easier maintenance
b) reduced file size
c) reduced bandwidth
d) improved flexibility

CSS Syntax
A style takes 3 sections or parts:
1. Single selector
selector {property:value}
selector- element you are styling
property-property title
value-style applying to the property.
NB: properties applying to one element are separated using semi-colons(;)
selector {property1:value1;property2:value2...;propertyn:valuen}
2. Multiple selectors
NB: several elements having same styling are separated using a comma(,).
Selector1,selector2...,selectorn{property:value}

3.Comment Tags
Unlike HTML which uses <!-- comments -->, CSS uses the following tags for
comments:
/* comments */
Nb:Can have single line or multiple line comments
4. CSS Classes
Elements that require styling can be grouped together depending on the user's
design needs.They are grouped into classes.Represented with the use of a dot(.)
Example
<p class=”kenya”>Is my country </p>
<p class=”kenya”>Is a great nation</p>
can be styled as:
.kenya{property:value}
5. CSS IDs
similar to classes EXCEPT once used can be re-declared.
Example
<p id=”kenya”>Is my country</p>
<p id=”uganda”>Has bananas</p>
can be styled as:
#kenya{property:value}
#uganda{property:value}
6.CSS Margins
Margin declares the space around an element. It can take four (4) sets:
top,left,bottom and right.
The value of the property can be :
- length(px)
- percentage
- or auto
It can be declared as a single property as follows:
margin: 5px 5px 5px 5px;
meaning: 5px top, 5px right, 5px bottom and 5px left.
NB: If one set once, then it applies to all sides;
margin: 5px;
NB: 2 values means application to opposing sides
1. margin: 5px 5px;
1st 5px to top and right sides
2nd 5px to bottom and left
2. margin: 5px 5px 5px;
1st 5px to top
2nd 5px to right and bottom
3rd 5px to left side
3. If you do not declare the margin of an element. Its value is set to zero
automatically
4.Negative values can also be used.
a) negative left and top move the elements left or top respectively.
b) negative right and bottom make their siblings move to the left and top
respectively.
CSS Padding
Padding- distance between the border of an element and the content within the
element.
NB:most properties are similar to those of margin,but it does not have auto
property and it uses 2values(length-px and percentage).
Padding: top right bottom right;
padding : 5px 5px 5px 5px;
CSS Text Properties
a) Text Color
color: value;
value can be :
i) color name eg. Color: green;
ii) hexadecimal eg. Color: #000;
iii) RGB eg. Rgb(0,0,0)
b) Text Align
text-align: value;
Value can be: right, left,center or justify
c) Text-Decoration
text-decoration: value;
Value can be: none, underline, overline, line through or blink.
d) Text-Transform
text-transform: value;
Value can be: none, capitalize or lowercase
e) Word Spacing
word-spacing: value;
Value can be: normal or length(px)
CSS Font Properties
a) Font family
font-family:value;
value can be: family name(e.g. Verdana) or generic name
b) Font-Size
font-size: value;
Value can be: percentage,length(px),small,large,medium,smaller,larger etc.
c) Font-Style
font-style: value;
Value can be: normal, italic or oblique
d) Font-Weight
font-weight: value;
Value can be: normal,bold,100-900
CSS Links Pseudo classes
Pseudo classes are applied to the links(anchors).
Can be: link,visited,hover,focus or active.
a:
a:
a:
a:
a:

link{property:value}
visited{property:value}
hover{property:value}
focus{property:value}
active{property:value}

CSS Backgrounds
The background of an element can be style using CSS.
a) Background-color
background-color: value;
value can be : color name, hexadecimal, rgb or just transparent.
b) Background-Image
background-image: value;
value can be: url(to the image) or none.
c) Background-position
background-position: value;
value can be: top left, top center, top right etc.
d) Background-repeat
You can set the image to repeat either horizontally(x) or vertically(y).
background-repeat: value;
value can be: repeat, repeat-x or repeat-y.

CSS Borders
a) Border-Color
border-color: value;
value can be : color name,hexadecimal or RGB format.
b) Border-Style
border-style: value;
value can be: solid, none,dotted,double,hidden etc.
c) Border-Width
border-width: value;
value can be : length(px), thin, medium or thick.
d) Border-Bottom
border-bottom: value;
value can be:
i) border-bottom-color: value;
ii)border-bottom-style:value;
iii)border-bottom-width:value;
NB: These values can be applied to border-top,border-left and border-right.
CSS Lists
Can be applied to both ordered and unordered lists
a) List style image
images can be used to represent bullets and other orderings.
List-style-image: url(path to image)
b) List style position
The type of bullets used can also be changed.
List-style-position: value;
value can be: disc,circle,square,decimal,none etc.
CSS Width and Height
a) Height
height: value;
value can be: auto,length(px) or percentage.
b) Width
width: value;
CSS Classifications
a) Clear
It is used to control the floated elements within a webpage.
clear: value;
value can be: none,both, left and none.
None- means floating elements can appear to any side of the element.
Both-means floated elements cannot appear to the left or the right.
Left-means floated elements cannot appear on the left.
Right- means floated elements cannot appear on the right.
b) Display
It controls how an element is displayed on the webpage.
Display: value;
Value can be: block,inline,list-item and none.
Block- creates a <br/> before and after the element.
inline- no <br/>
list-item- creates a <br/> before and after the element and adds a list item
none- element is not displayed on the page.
c) Float
This controls the display position of the element on the block of a webpage.
Float: value;
value can be: left,right or none.
Left: displays element to the left.
Right: displays element to the right.
None: no change in the display.(element position not affected)
d) Overflow
This controls the content if it exceeds it allocated boundary.
Overflow: value;
Value can be: auto, hidden,visible or scroll.
CSS positioning
It changes how elements are positioned on the webpage.
Position: value;
value can be: static, relative, absolute or fixed.
Static- default.
Relative- it offsets content to the righ,top,bottom or left which may overlap
other content on the page and maintains the normal flow of the webpage.
Absolute-this removes the element from the normal flow of the webpage and
places the element to the top left of the webpage or its parent element.If it does
not have a parent, then it is placed at the top left of the browser.
Fixed- just like static, but wont scroll even when other content on the page
scrolls.

Más contenido relacionado

Similar a Art of css

Similar a Art of css (20)

CSS_Day_Three (W3schools)
CSS_Day_Three (W3schools)CSS_Day_Three (W3schools)
CSS_Day_Three (W3schools)
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) Works
 
Basic css
Basic cssBasic css
Basic css
 
CSS
CSSCSS
CSS
 
CSS Cascade Style Sheet
CSS Cascade Style SheetCSS Cascade Style Sheet
CSS Cascade Style Sheet
 
CSS for basic learner
CSS for basic learnerCSS for basic learner
CSS for basic learner
 
Designing for the web - 101
Designing for the web - 101Designing for the web - 101
Designing for the web - 101
 
CSS - Basics
CSS - BasicsCSS - Basics
CSS - Basics
 
Css from scratch
Css from scratchCss from scratch
Css from scratch
 
5. Web Technology CSS Advanced
5. Web Technology CSS Advanced 5. Web Technology CSS Advanced
5. Web Technology CSS Advanced
 
Web Programming-css.pptx
Web Programming-css.pptxWeb Programming-css.pptx
Web Programming-css.pptx
 
Css
CssCss
Css
 
CSS3 Refresher
CSS3 RefresherCSS3 Refresher
CSS3 Refresher
 
Css class-02
Css class-02Css class-02
Css class-02
 
Css jon duckett - flashcards
Css   jon duckett - flashcardsCss   jon duckett - flashcards
Css jon duckett - flashcards
 
CSS3 notes
CSS3 notesCSS3 notes
CSS3 notes
 
Web Layout
Web LayoutWeb Layout
Web Layout
 
Sass Essentials
Sass EssentialsSass Essentials
Sass Essentials
 
Web Development 4
Web Development 4Web Development 4
Web Development 4
 
Web Development 4 (HTML & CSS)
Web Development 4 (HTML & CSS)Web Development 4 (HTML & CSS)
Web Development 4 (HTML & CSS)
 

Más de Raphael Wanjiku

Más de Raphael Wanjiku (6)

Business process and is lecture 2
Business process and is lecture 2Business process and is lecture 2
Business process and is lecture 2
 
Introduction to mis
Introduction to misIntroduction to mis
Introduction to mis
 
phpClasses and Jquery
phpClasses and JqueryphpClasses and Jquery
phpClasses and Jquery
 
Developing midlets
Developing midletsDeveloping midlets
Developing midlets
 
Introduction to java micro edition
Introduction to java micro editionIntroduction to java micro edition
Introduction to java micro edition
 
Json
JsonJson
Json
 

Último

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Último (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

Art of css

  • 1. THE ART OF CSS RAPHAEL WANJIKU SOFTWARE DEVELOPER raphael@incsyncweb.com
  • 2. The Art of CSS CSS allows separation of the HTML content from its styling. It is responsible for the presentation(text formatting,colors,fonts,borders etc). Applying CSS Can be applied either: i) internally- inline or within the same page holding the HTML content <head> <style type=”text/css”> .....styles </style> </head> ii) Externally- defined in a different file and then called withing the page holding the HTML content.(called in the head of the page) <head> <link rel=”stylesheet” type=”text/css” href=”path to the css file” /> OR use @import method <style type=”text/css”>@import url(path to the css file”)</style> </head> Reasons for using external CSS: a) easier maintenance b) reduced file size c) reduced bandwidth d) improved flexibility CSS Syntax A style takes 3 sections or parts:
  • 3. 1. Single selector selector {property:value} selector- element you are styling property-property title value-style applying to the property. NB: properties applying to one element are separated using semi-colons(;) selector {property1:value1;property2:value2...;propertyn:valuen} 2. Multiple selectors NB: several elements having same styling are separated using a comma(,). Selector1,selector2...,selectorn{property:value} 3.Comment Tags Unlike HTML which uses <!-- comments -->, CSS uses the following tags for comments: /* comments */ Nb:Can have single line or multiple line comments 4. CSS Classes Elements that require styling can be grouped together depending on the user's design needs.They are grouped into classes.Represented with the use of a dot(.) Example <p class=”kenya”>Is my country </p> <p class=”kenya”>Is a great nation</p> can be styled as: .kenya{property:value}
  • 4. 5. CSS IDs similar to classes EXCEPT once used can be re-declared. Example <p id=”kenya”>Is my country</p> <p id=”uganda”>Has bananas</p> can be styled as: #kenya{property:value} #uganda{property:value} 6.CSS Margins Margin declares the space around an element. It can take four (4) sets: top,left,bottom and right. The value of the property can be : - length(px) - percentage - or auto It can be declared as a single property as follows: margin: 5px 5px 5px 5px; meaning: 5px top, 5px right, 5px bottom and 5px left. NB: If one set once, then it applies to all sides; margin: 5px; NB: 2 values means application to opposing sides 1. margin: 5px 5px; 1st 5px to top and right sides 2nd 5px to bottom and left 2. margin: 5px 5px 5px;
  • 5. 1st 5px to top 2nd 5px to right and bottom 3rd 5px to left side 3. If you do not declare the margin of an element. Its value is set to zero automatically 4.Negative values can also be used. a) negative left and top move the elements left or top respectively. b) negative right and bottom make their siblings move to the left and top respectively. CSS Padding Padding- distance between the border of an element and the content within the element. NB:most properties are similar to those of margin,but it does not have auto property and it uses 2values(length-px and percentage). Padding: top right bottom right; padding : 5px 5px 5px 5px; CSS Text Properties a) Text Color color: value; value can be : i) color name eg. Color: green; ii) hexadecimal eg. Color: #000; iii) RGB eg. Rgb(0,0,0)
  • 6. b) Text Align text-align: value; Value can be: right, left,center or justify c) Text-Decoration text-decoration: value; Value can be: none, underline, overline, line through or blink. d) Text-Transform text-transform: value; Value can be: none, capitalize or lowercase e) Word Spacing word-spacing: value; Value can be: normal or length(px) CSS Font Properties a) Font family font-family:value; value can be: family name(e.g. Verdana) or generic name b) Font-Size font-size: value; Value can be: percentage,length(px),small,large,medium,smaller,larger etc. c) Font-Style font-style: value; Value can be: normal, italic or oblique
  • 7. d) Font-Weight font-weight: value; Value can be: normal,bold,100-900 CSS Links Pseudo classes Pseudo classes are applied to the links(anchors). Can be: link,visited,hover,focus or active. a: a: a: a: a: link{property:value} visited{property:value} hover{property:value} focus{property:value} active{property:value} CSS Backgrounds The background of an element can be style using CSS. a) Background-color background-color: value; value can be : color name, hexadecimal, rgb or just transparent. b) Background-Image background-image: value; value can be: url(to the image) or none. c) Background-position background-position: value; value can be: top left, top center, top right etc.
  • 8. d) Background-repeat You can set the image to repeat either horizontally(x) or vertically(y). background-repeat: value; value can be: repeat, repeat-x or repeat-y. CSS Borders a) Border-Color border-color: value; value can be : color name,hexadecimal or RGB format. b) Border-Style border-style: value; value can be: solid, none,dotted,double,hidden etc. c) Border-Width border-width: value; value can be : length(px), thin, medium or thick. d) Border-Bottom border-bottom: value; value can be: i) border-bottom-color: value; ii)border-bottom-style:value;
  • 9. iii)border-bottom-width:value; NB: These values can be applied to border-top,border-left and border-right. CSS Lists Can be applied to both ordered and unordered lists a) List style image images can be used to represent bullets and other orderings. List-style-image: url(path to image) b) List style position The type of bullets used can also be changed. List-style-position: value; value can be: disc,circle,square,decimal,none etc. CSS Width and Height a) Height height: value; value can be: auto,length(px) or percentage. b) Width width: value; CSS Classifications a) Clear It is used to control the floated elements within a webpage. clear: value; value can be: none,both, left and none.
  • 10. None- means floating elements can appear to any side of the element. Both-means floated elements cannot appear to the left or the right. Left-means floated elements cannot appear on the left. Right- means floated elements cannot appear on the right. b) Display It controls how an element is displayed on the webpage. Display: value; Value can be: block,inline,list-item and none. Block- creates a <br/> before and after the element. inline- no <br/> list-item- creates a <br/> before and after the element and adds a list item none- element is not displayed on the page. c) Float This controls the display position of the element on the block of a webpage. Float: value; value can be: left,right or none. Left: displays element to the left. Right: displays element to the right. None: no change in the display.(element position not affected) d) Overflow This controls the content if it exceeds it allocated boundary.
  • 11. Overflow: value; Value can be: auto, hidden,visible or scroll. CSS positioning It changes how elements are positioned on the webpage. Position: value; value can be: static, relative, absolute or fixed. Static- default. Relative- it offsets content to the righ,top,bottom or left which may overlap other content on the page and maintains the normal flow of the webpage. Absolute-this removes the element from the normal flow of the webpage and places the element to the top left of the webpage or its parent element.If it does not have a parent, then it is placed at the top left of the browser. Fixed- just like static, but wont scroll even when other content on the page scrolls.