SlideShare a Scribd company logo
by  DHANESH.T.S CSS
What    is  Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.  PUNE  IT  LABS
Advantages of CSS Completely consistent with the look and feel of your pages  More control over the layout and design  Pages download faster, sometimes by as much as 50%  You have to type less code, and your pages are shorter and neater.  CSS properties can also be dynamically changed with a JavaScript. eg.  object .style.cssFloat="left"  PUNE  IT  LABS
. With a combination of positioning, floating, margins, padding and borders, you should be able to represent ANY web design and there is nothing that can be done in tables that can not be done with CSS. PUNE  IT  LABS
There are three parts to CSS The styles a blue headline eg: <font color=&quot;#0000ff&quot;><h4>a blue headline</h4></font>  a blue headline Their placement The fact that they can cascade. PUNE  IT  LABS
Where HTML has tags, CSS has 'selectors'.   A Cascading Style Sheets rule is made up of a selector and a declaration. H2 {color: blue;} selector {declaration;} The declaration is the part of the rule inside the curly braces. It specifies what a style effect will be. For example, &quot;color: blue&quot;. Eg:   body {       font-size: 12px;       color: navy;  }   PUNE  IT  LABS
A declaration has two parts separated by a colon: property and value. selector {property:value} More than one declaration may be placed inside the curly braces  A semi-colon must separate each declaration from the next. The ending declaration does not require a semi-colon  Eg.  selector {property:value; property:value;}   H2 {color:blue; font-family:Arial, sans-serif;} If you neglect to place a semi-colon between any two declarations your style sheet will totally fail.  H1 {font-family:Arial, Helvetica, sans-serif;} H2 {font-family:Arial, Helvetica, sans-serif;} H3 {font-family:Arial, Helvetica, sans-serif;}   H1, H2, H3 {font-family:Arial, Helvetica, sans-serif;} PUNE  IT  LABS
In-line Internal External Applying CSS PUNE  IT  LABS
<p style=&quot;color: red&quot;>Sample text</p>   In-line HTML should be a  presentation free  document, and so in-line styles should be avoided wherever possible. PUNE  IT  LABS
<html>    <head>    <title>CSS Example</title>    <style type=&quot;text/css&quot;>        p {          color: red;          }      a {              color: blue;          }     </style>     .......  Internal PUNE  IT  LABS
p {        color: red;   }   a {        color: blue;   }   <html>  <head>  <title>CSS Example</title>       <link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;web.css&quot; />   ...  External PUNE  IT  LABS
Lengths and Percentages There are specific units for values used in CSS, but there are some general units that are used in a number of properties Such as-  em  (such as font-size: 2em) ex  (one ex is the x-height of a font (x-height is usually about half the font-size)   px  (such as font-size: 12px)  pixels  pt  (such as font-size: 12pt)  point (1 pt is the same as 1/72 inch)  pc  pica (1 pc is the same as 12 points)  %  (such as font-size: 80%)percentage Other units include  cm  (centimetres),  mm  (millimetres) and  in  (inches). When a value is  zero , you do not need to state a unit.  Eg: border : 0 PUNE  IT  LABS
Different foms: Name of Colour RGB HEX code CSS brings 16 million  colours to Web Page. There are 17 valid predefined colour names.  They are  -  aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, orange, purple, red, silver, teal, white, and yellow. PUNE  IT  LABS
red rgb(255,0,0) rgb(100%,0%,0%) #ff0000 #f00 transparent  is also a valid value. The three values in the rbg value are from 0 to 255. Hexadecimal  is a  base-16  number system. hexadecimal has 16 digits, from 0 to f. The hex number is prefixed with a hash character ( # ) and can be three or six digits in length. Basically, the three-digit version is a compressed version of the six-digit (#f00 becomes #ff0000, #c96 becomes #cc9966 etc.).  PUNE  IT  LABS
None  : The element will not be displayed. p {display : none} Block  : The element will be displayed as a block-level element, with a line break before and after the element. p {display : block} Inline  : The element will be displayed as an inline element, with no line break before or after the element. p {display : inline} PUNE  IT  LABS
Other display types ol ul PUNE  IT  LABS
Static Relative Absolute Fixed PUNE  IT  LABS
Static: The value static is the default value for elements and renders the position in the normal order of things as they appear in the html Relative: It is much like static, but the element can be offset from its original position with the properties  top ,  right ,  bottom  and  left  . Absolute: The absolute element can be placed anywhere on the page using  top ,  right ,  bottom  and  left  . Fixed: It behaves like absolute, but fixed elements should stay exactly where they are on the screen even when the page is scrolled.  PUNE  IT  LABS
Floating an element will shift it to the right or left of a line, with surrounding content flowing around it. Floating is normally used to position smaller elements within a page  Eg: img   {   float: left   }  PUNE  IT  LABS
Clear: The CSS clear property is used to for control flow when using the float property. Using CSS clear, you can specify whether to keep one or both sides of an element &quot;clear&quot; (i.e. no elements can appear on the side that is clear).  none - floating elements can appear on either side  left - floating elements can not appear on the left (i.e. keep the left side &quot;clear&quot;)  right - floating elements can not appear on the right (i.e. keep the right side &quot;clear&quot;)  both - floating elements can not appear on the left or right (i.e. keep both sides &quot;clear&quot;)  inherit  PUNE  IT  LABS
Font-family The font you specify must be on the user's computer, so there is little point in using obscure fonts. The most commonly used are arial, verdana and times new roman), but you can specify more than one font, separated by  commas . If the name of the font is more than one word it should be  put in quotation marks (“------“) Font-size The size of the font. Be careful with this - text such as headings should not just be a paragraph in a large font; you should still use headings ( h1 ,  h2  etc.) PUNE  IT  LABS
Font-weight This states whether the text is bold or not.  Commonly used are  font-weight: bold or font-weight: normal. In theory it can also be bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800 or 900 Font-style font-style:  italic  or font-style: normal . Text-decoration This states whether the text is underlined or not.  text-decoration: overline text-decoration: line-through , strike-through,  text-decoration: underline (  should only be used for links ) This property is usually used to decorate links, such as specifying no underline with  text-decoration: none. PUNE  IT  LABS
text-transform This will change the case of the text. text-transform: capitalize   text-transform: uppercase   text-transform: lowercase   text-transform: none Text spacing letter-spacing  and  word-spacing   line-height   text-align text-indent Eg.   p {       letter-spacing: 2px;        word-spacing: 3px;        line-height: 4px;        text-align: center;   }  PUNE  IT  LABS
Margins and Padding Margins  and  Padding  are the two most commonly used properties for spacing-out elements. A margin is the space  outside  of the element, whereas padding is the space  inside  the element. Eg: h2 {      font-size: 10px;      background-color: #1F488D;      margin: 10px;      padding: 5px;  }  PUNE  IT  LABS
Padding padding can have:  #sample  { padding: 10px; } #sample  { padding: 10px 5px } #sample  { padding: 10px 5px 2px } #sample  { padding: 10px 5px 2px 5px } one value, such as 10px, to specify equal padding on every side  two values, such as 10px 5px, to specify top/bottom (first value) and right/left (second value) padding  three values, such as 10px 5px 2px, to specify top (first value), right/left (second value) and bottom (third value) padding  four values, such as 10px 5px 2px 1px to specify top, right, bottom and left padding respectively  PUNE  IT  LABS
Borders  can be applied to most HTML elements within the body. border-style The values can be  solid ,  dotted ,  dashed ,  double ,  groove ,  ridge ,  inset  and  outset . border-width   border-top-width ,  border-right-widht ,  border-bottom-width  and  border-left-width border-color   Add the following code to the CSS file: Eg.   h2 {     border-style: dashed;       border-width: 3px;     border-left-width: 10px;      border-right-width: 10px;       border-color: red;  }  PUNE  IT  LABS
PUNE  IT  LABS by- DHANESH.T.S

More Related Content

What's hot (20)

PPT
Cascading Style Sheets (CSS) help
casestudyhelp
 
PPT
CSS ppt
Sanmuga Nathan
 
PPTX
Html n CSS
Sukrit Gupta
 
PDF
Intro to HTML and CSS basics
Eliran Eliassy
 
PPTX
html-css
Dhirendra Chauhan
 
PPSX
Introduction to css
Evolution Network
 
PDF
Introduction to html
eShikshak
 
PPTX
Introduction to CSS
Folasade Adedeji
 
PPTX
Html ppt
santosh lamba
 
PPT
Web Development using HTML & CSS
Shashank Skills Academy
 
PPTX
HTML5 & CSS3
Ian Lintner
 
PDF
Html / CSS Presentation
Shawn Calvert
 
PPTX
Introduction to HTML
Ajay Khatri
 
PPT
Span and Div tags in HTML
Biswadip Goswami
 
PPTX
HTML (Web) basics for a beginner
Jayapal Reddy Nimmakayala
 
PPTX
Cascading style sheet
Michael Jhon
 
PPT
Introduction to Cascading Style Sheets (CSS)
Chris Poteet
 
PPT
CSS Basics
WordPress Memphis
 
Cascading Style Sheets (CSS) help
casestudyhelp
 
Html n CSS
Sukrit Gupta
 
Intro to HTML and CSS basics
Eliran Eliassy
 
Introduction to css
Evolution Network
 
Introduction to html
eShikshak
 
Introduction to CSS
Folasade Adedeji
 
Html ppt
santosh lamba
 
Web Development using HTML & CSS
Shashank Skills Academy
 
HTML5 & CSS3
Ian Lintner
 
Html / CSS Presentation
Shawn Calvert
 
Introduction to HTML
Ajay Khatri
 
Span and Div tags in HTML
Biswadip Goswami
 
HTML (Web) basics for a beginner
Jayapal Reddy Nimmakayala
 
Cascading style sheet
Michael Jhon
 
Introduction to Cascading Style Sheets (CSS)
Chris Poteet
 
CSS Basics
WordPress Memphis
 

Similar to CSS for Beginners (20)

PPT
CSS
ARJUN
 
PPT
Css
Rathan Raj
 
PPT
Basics Of Css And Some Common Mistakes
sanjay2211
 
PPT
CSS
bjornh
 
PPTX
Cascading Style Sheet presentation .pptx
ShyamKumarSahu2
 
PPTX
CSS Notes for web development and frontend.pptx
kolekarkeshav38
 
PPT
CSS For Online Journalism
amherstwire
 
PPTX
CSS3 notes
Rex Wang
 
PDF
cascading stylesheet_cssppt-100604051600-phpapp02.pdf
hinalsomani93
 
PPT
3.2 introduction to css
Bulldogs83
 
PPT
3.2 introduction to css
Bulldogs83
 
PPTX
L4 Fashioning Text Styles and Colors
mykella
 
PPT
cascading style sheet ppt
abhilashagupta
 
PDF
CSS Notes in PDF, Easy to understand. For beginner to advanced. ...
syedfaisal759877
 
PPT
CSS Basic and Common Errors
Hock Leng PUAH
 
PPTX
CSS
DivyaKS12
 
ODP
Css.prabu
Prabu Cse
 
PPTX
Css Complete Notes
EPAM Systems
 
PPTX
Presentation on CSS, Style Sheet, Types of Styles, Types of Text Formatting, ...
SripathiRavi1
 
PDF
Css
actacademy
 
CSS
ARJUN
 
Basics Of Css And Some Common Mistakes
sanjay2211
 
CSS
bjornh
 
Cascading Style Sheet presentation .pptx
ShyamKumarSahu2
 
CSS Notes for web development and frontend.pptx
kolekarkeshav38
 
CSS For Online Journalism
amherstwire
 
CSS3 notes
Rex Wang
 
cascading stylesheet_cssppt-100604051600-phpapp02.pdf
hinalsomani93
 
3.2 introduction to css
Bulldogs83
 
3.2 introduction to css
Bulldogs83
 
L4 Fashioning Text Styles and Colors
mykella
 
cascading style sheet ppt
abhilashagupta
 
CSS Notes in PDF, Easy to understand. For beginner to advanced. ...
syedfaisal759877
 
CSS Basic and Common Errors
Hock Leng PUAH
 
Css.prabu
Prabu Cse
 
Css Complete Notes
EPAM Systems
 
Presentation on CSS, Style Sheet, Types of Styles, Types of Text Formatting, ...
SripathiRavi1
 
Ad

More from Amit Kumar Singh (20)

PPTX
Improving Core Web Vitals for WordPress
Amit Kumar Singh
 
PPTX
Getting started with WordPress Development
Amit Kumar Singh
 
PPTX
Alternate Development Techniques on WordPress
Amit Kumar Singh
 
PPTX
Building Minimal Viable Product (MVP) with WordPress
Amit Kumar Singh
 
PPTX
Rapid Prototyping With WordPress
Amit Kumar Singh
 
PPTX
Stop Coding; Start Assembling Your Websites
Amit Kumar Singh
 
PPTX
WordPress as Rapid Prototyping Tool
Amit Kumar Singh
 
PPTX
WordPress Use Cases
Amit Kumar Singh
 
PPTX
Leveraging your business with WordPress
Amit Kumar Singh
 
PPT
Maharashtra at a glance
Amit Kumar Singh
 
PDF
Custom Post Type and Taxonomies in WordPress 3.x
Amit Kumar Singh
 
PPTX
WPoid : You Blog, We Take Care Of The Rest
Amit Kumar Singh
 
ODP
Joomla Day India 2009 Business Logic With The Mvc
Amit Kumar Singh
 
PPT
Joomla Request To Response
Amit Kumar Singh
 
PPT
Introduction to web services and how to in php
Amit Kumar Singh
 
PPT
Getting Started With Php Frameworks @BCP5
Amit Kumar Singh
 
PPT
Php Security
Amit Kumar Singh
 
PPT
Open Social Phpcamp
Amit Kumar Singh
 
PPT
Overview Of Drupal
Amit Kumar Singh
 
PPT
PHP tips by a MYSQL DBA
Amit Kumar Singh
 
Improving Core Web Vitals for WordPress
Amit Kumar Singh
 
Getting started with WordPress Development
Amit Kumar Singh
 
Alternate Development Techniques on WordPress
Amit Kumar Singh
 
Building Minimal Viable Product (MVP) with WordPress
Amit Kumar Singh
 
Rapid Prototyping With WordPress
Amit Kumar Singh
 
Stop Coding; Start Assembling Your Websites
Amit Kumar Singh
 
WordPress as Rapid Prototyping Tool
Amit Kumar Singh
 
WordPress Use Cases
Amit Kumar Singh
 
Leveraging your business with WordPress
Amit Kumar Singh
 
Maharashtra at a glance
Amit Kumar Singh
 
Custom Post Type and Taxonomies in WordPress 3.x
Amit Kumar Singh
 
WPoid : You Blog, We Take Care Of The Rest
Amit Kumar Singh
 
Joomla Day India 2009 Business Logic With The Mvc
Amit Kumar Singh
 
Joomla Request To Response
Amit Kumar Singh
 
Introduction to web services and how to in php
Amit Kumar Singh
 
Getting Started With Php Frameworks @BCP5
Amit Kumar Singh
 
Php Security
Amit Kumar Singh
 
Open Social Phpcamp
Amit Kumar Singh
 
Overview Of Drupal
Amit Kumar Singh
 
PHP tips by a MYSQL DBA
Amit Kumar Singh
 
Ad

Recently uploaded (20)

PDF
Buy Boys Long Sleeve T-shirts at Port 213
Port 213
 
PDF
15 Essential Cloud Podcasts Every Tech Professional Should Know in 2025
Amnic
 
PPTX
Washington University of Health and Science A Choice You Can Trust
Washington University of Health and Science
 
PDF
Keppel Investor Day 2025 Presentation Slides GCAT.pdf
KeppelCorporation
 
PDF
NewBase 07 July 2025 Energy News issue - 1800 by Khaled Al Awadi_compressed.pdf
Khaled Al Awadi
 
PDF
Smart Lead Magnet Review: Effortless Email List Growth with Automated Funnels...
Larry888358
 
PPTX
Hackathon - Technology - Idea Submission Template -HackerEarth.pptx
nanster236
 
PDF
SUMMER SAFETY FLYER SPECIAL Q3 - 16 Pages
One Source Industrial Supplies
 
PPTX
2025 July - ABM for B2B in Hubspot - Demand Gen HUG.pptx
mjenkins13
 
PDF
NewBase 03 July 2025 Energy News issue - 1799 by Khaled Al Awadi_compressed.pdf
Khaled Al Awadi
 
PDF
Flexible Metal Hose & Custom Hose Assemblies
McGill Hose & Coupling Inc
 
PDF
Blind Spots in Business: Unearthing Hidden Challenges in Today's Organizations
Crimson Business Consulting
 
PDF
Azumah Resources reaffirms commitment to Ghana amid dispute with Engineers & ...
Kweku Zurek
 
PPTX
Technical Analysis of 1st Generation Biofuel Feedstocks - 25th June 2025
TOFPIK
 
PPTX
Why-Your-BPO-Startup-Must-Track-Attrition-from-Day-One.pptx.pptx
Orage technologies
 
PPTX
GE%205.pptx BUSINESS EMAIL this report aims
KenSantos27
 
PPTX
25 Future Mega Trends Reshaping the World in 2025 and Beyond
presentifyai
 
PPTX
Build Wealth & Protect Your Legacy with Indexed Universal Life Insurance
iulfinancial6
 
PDF
Native Sons Of The Golden West - Boasts A Legacy Of Impactful Leadership
Native Sons of the Golden West
 
PDF
Securiport - A Global Leader
Securiport
 
Buy Boys Long Sleeve T-shirts at Port 213
Port 213
 
15 Essential Cloud Podcasts Every Tech Professional Should Know in 2025
Amnic
 
Washington University of Health and Science A Choice You Can Trust
Washington University of Health and Science
 
Keppel Investor Day 2025 Presentation Slides GCAT.pdf
KeppelCorporation
 
NewBase 07 July 2025 Energy News issue - 1800 by Khaled Al Awadi_compressed.pdf
Khaled Al Awadi
 
Smart Lead Magnet Review: Effortless Email List Growth with Automated Funnels...
Larry888358
 
Hackathon - Technology - Idea Submission Template -HackerEarth.pptx
nanster236
 
SUMMER SAFETY FLYER SPECIAL Q3 - 16 Pages
One Source Industrial Supplies
 
2025 July - ABM for B2B in Hubspot - Demand Gen HUG.pptx
mjenkins13
 
NewBase 03 July 2025 Energy News issue - 1799 by Khaled Al Awadi_compressed.pdf
Khaled Al Awadi
 
Flexible Metal Hose & Custom Hose Assemblies
McGill Hose & Coupling Inc
 
Blind Spots in Business: Unearthing Hidden Challenges in Today's Organizations
Crimson Business Consulting
 
Azumah Resources reaffirms commitment to Ghana amid dispute with Engineers & ...
Kweku Zurek
 
Technical Analysis of 1st Generation Biofuel Feedstocks - 25th June 2025
TOFPIK
 
Why-Your-BPO-Startup-Must-Track-Attrition-from-Day-One.pptx.pptx
Orage technologies
 
GE%205.pptx BUSINESS EMAIL this report aims
KenSantos27
 
25 Future Mega Trends Reshaping the World in 2025 and Beyond
presentifyai
 
Build Wealth & Protect Your Legacy with Indexed Universal Life Insurance
iulfinancial6
 
Native Sons Of The Golden West - Boasts A Legacy Of Impactful Leadership
Native Sons of the Golden West
 
Securiport - A Global Leader
Securiport
 

CSS for Beginners

  • 2. What is Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents. PUNE IT LABS
  • 3. Advantages of CSS Completely consistent with the look and feel of your pages More control over the layout and design Pages download faster, sometimes by as much as 50% You have to type less code, and your pages are shorter and neater. CSS properties can also be dynamically changed with a JavaScript. eg. object .style.cssFloat=&quot;left&quot; PUNE IT LABS
  • 4. . With a combination of positioning, floating, margins, padding and borders, you should be able to represent ANY web design and there is nothing that can be done in tables that can not be done with CSS. PUNE IT LABS
  • 5. There are three parts to CSS The styles a blue headline eg: <font color=&quot;#0000ff&quot;><h4>a blue headline</h4></font> a blue headline Their placement The fact that they can cascade. PUNE IT LABS
  • 6. Where HTML has tags, CSS has 'selectors'. A Cascading Style Sheets rule is made up of a selector and a declaration. H2 {color: blue;} selector {declaration;} The declaration is the part of the rule inside the curly braces. It specifies what a style effect will be. For example, &quot;color: blue&quot;. Eg: body {      font-size: 12px;      color: navy; } PUNE IT LABS
  • 7. A declaration has two parts separated by a colon: property and value. selector {property:value} More than one declaration may be placed inside the curly braces A semi-colon must separate each declaration from the next. The ending declaration does not require a semi-colon Eg. selector {property:value; property:value;} H2 {color:blue; font-family:Arial, sans-serif;} If you neglect to place a semi-colon between any two declarations your style sheet will totally fail. H1 {font-family:Arial, Helvetica, sans-serif;} H2 {font-family:Arial, Helvetica, sans-serif;} H3 {font-family:Arial, Helvetica, sans-serif;} H1, H2, H3 {font-family:Arial, Helvetica, sans-serif;} PUNE IT LABS
  • 8. In-line Internal External Applying CSS PUNE IT LABS
  • 9. <p style=&quot;color: red&quot;>Sample text</p> In-line HTML should be a presentation free document, and so in-line styles should be avoided wherever possible. PUNE IT LABS
  • 10. <html> <head> <title>CSS Example</title> <style type=&quot;text/css&quot;>     p {       color: red;       }   a {           color: blue;       } </style> ....... Internal PUNE IT LABS
  • 11. p {      color: red; } a {      color: blue; } <html> <head> <title>CSS Example</title>      <link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;web.css&quot; /> ... External PUNE IT LABS
  • 12. Lengths and Percentages There are specific units for values used in CSS, but there are some general units that are used in a number of properties Such as- em (such as font-size: 2em) ex (one ex is the x-height of a font (x-height is usually about half the font-size) px (such as font-size: 12px) pixels pt (such as font-size: 12pt) point (1 pt is the same as 1/72 inch) pc pica (1 pc is the same as 12 points) % (such as font-size: 80%)percentage Other units include cm (centimetres), mm (millimetres) and in (inches). When a value is zero , you do not need to state a unit. Eg: border : 0 PUNE IT LABS
  • 13. Different foms: Name of Colour RGB HEX code CSS brings 16 million colours to Web Page. There are 17 valid predefined colour names. They are - aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, orange, purple, red, silver, teal, white, and yellow. PUNE IT LABS
  • 14. red rgb(255,0,0) rgb(100%,0%,0%) #ff0000 #f00 transparent is also a valid value. The three values in the rbg value are from 0 to 255. Hexadecimal is a base-16 number system. hexadecimal has 16 digits, from 0 to f. The hex number is prefixed with a hash character ( # ) and can be three or six digits in length. Basically, the three-digit version is a compressed version of the six-digit (#f00 becomes #ff0000, #c96 becomes #cc9966 etc.). PUNE IT LABS
  • 15. None : The element will not be displayed. p {display : none} Block : The element will be displayed as a block-level element, with a line break before and after the element. p {display : block} Inline : The element will be displayed as an inline element, with no line break before or after the element. p {display : inline} PUNE IT LABS
  • 16. Other display types ol ul PUNE IT LABS
  • 17. Static Relative Absolute Fixed PUNE IT LABS
  • 18. Static: The value static is the default value for elements and renders the position in the normal order of things as they appear in the html Relative: It is much like static, but the element can be offset from its original position with the properties top , right , bottom and left . Absolute: The absolute element can be placed anywhere on the page using top , right , bottom and left . Fixed: It behaves like absolute, but fixed elements should stay exactly where they are on the screen even when the page is scrolled. PUNE IT LABS
  • 19. Floating an element will shift it to the right or left of a line, with surrounding content flowing around it. Floating is normally used to position smaller elements within a page Eg: img { float: left } PUNE IT LABS
  • 20. Clear: The CSS clear property is used to for control flow when using the float property. Using CSS clear, you can specify whether to keep one or both sides of an element &quot;clear&quot; (i.e. no elements can appear on the side that is clear). none - floating elements can appear on either side left - floating elements can not appear on the left (i.e. keep the left side &quot;clear&quot;) right - floating elements can not appear on the right (i.e. keep the right side &quot;clear&quot;) both - floating elements can not appear on the left or right (i.e. keep both sides &quot;clear&quot;) inherit PUNE IT LABS
  • 21. Font-family The font you specify must be on the user's computer, so there is little point in using obscure fonts. The most commonly used are arial, verdana and times new roman), but you can specify more than one font, separated by commas . If the name of the font is more than one word it should be put in quotation marks (“------“) Font-size The size of the font. Be careful with this - text such as headings should not just be a paragraph in a large font; you should still use headings ( h1 , h2 etc.) PUNE IT LABS
  • 22. Font-weight This states whether the text is bold or not. Commonly used are font-weight: bold or font-weight: normal. In theory it can also be bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800 or 900 Font-style font-style: italic or font-style: normal . Text-decoration This states whether the text is underlined or not. text-decoration: overline text-decoration: line-through , strike-through, text-decoration: underline ( should only be used for links ) This property is usually used to decorate links, such as specifying no underline with text-decoration: none. PUNE IT LABS
  • 23. text-transform This will change the case of the text. text-transform: capitalize text-transform: uppercase text-transform: lowercase text-transform: none Text spacing letter-spacing and word-spacing line-height text-align text-indent Eg. p {      letter-spacing: 2px;      word-spacing: 3px;      line-height: 4px;      text-align: center; } PUNE IT LABS
  • 24. Margins and Padding Margins and Padding are the two most commonly used properties for spacing-out elements. A margin is the space outside of the element, whereas padding is the space inside the element. Eg: h2 {     font-size: 10px;     background-color: #1F488D;     margin: 10px;     padding: 5px; } PUNE IT LABS
  • 25. Padding padding can have: #sample { padding: 10px; } #sample { padding: 10px 5px } #sample { padding: 10px 5px 2px } #sample { padding: 10px 5px 2px 5px } one value, such as 10px, to specify equal padding on every side two values, such as 10px 5px, to specify top/bottom (first value) and right/left (second value) padding three values, such as 10px 5px 2px, to specify top (first value), right/left (second value) and bottom (third value) padding four values, such as 10px 5px 2px 1px to specify top, right, bottom and left padding respectively PUNE IT LABS
  • 26. Borders can be applied to most HTML elements within the body. border-style The values can be solid , dotted , dashed , double , groove , ridge , inset and outset . border-width border-top-width , border-right-widht , border-bottom-width and border-left-width border-color Add the following code to the CSS file: Eg. h2 {    border-style: dashed;      border-width: 3px;    border-left-width: 10px;     border-right-width: 10px;      border-color: red; } PUNE IT LABS
  • 27. PUNE IT LABS by- DHANESH.T.S