SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Downloaden Sie, um offline zu lesen
CSS Reference




 Anuja Madushan | www.anujalk.info
All CSS Background Properties
The number in the "CSS" column indicates in which CSS version the property
is defined (CSS1 or CSS2).


Property              Description               Values
                                                background-color
                      Sets all the              background-image
                      background                background-repeat
background
                      properties in one         background-attachment
                      declaration               background-position
                                                inherit
                 Sets whether a
                                       scroll
background-      background image is
                                       fixed
attachment       fixed or scrolls with
                                       inherit
                 the rest of the page
                                       color-rgb
                                       color-hex
                 Sets the background
background-color                       color-name
                 color of an element
                                       transparent
                                       inherit
                 Sets the background url(URL)
background-
                 image for an          none
image
                 element               inherit
                                       left top
                                       left center
                                       left bottom
                                       right top
                                       right center
                 Sets the starting
background-                            right bottom
                 position of a
position                               center top
                 background image
                                       center center
                                       center bottom
                                       x% y%
                                       xpos ypos
                                       inherit
                                       repeat
                 Sets if/how a         repeat-x
background-
                 background image      repeat-y
repeat
                 will be repeated      no-repeat
                                       inherit
All CSS Text Properties
The number in the "CSS" column indicates in which CSS
version the property is defined (CSS1 or CSS2).

Property    Description                       Values
color       Sets the color of a text          color
                                              ltr
direction   Sets the text direction
                                              rtl
                                              normal
                                              number
line-height Sets the distance between lines
                                              length
                                              %
letter-     Increase or decrease the space normal
spacing     between characters                length
                                              left
                                              right
text-align Aligns the text in an element
                                              center
                                              justify
                                              none
                                              underline
text-
            Adds decoration to text           overline
decoration
                                              line-through
                                              blink
            Indents the first line of text in length
text-indent
            an element                        %
                                              none
text-
                                              color
shadow
                                              length
                                              none
text-       Controls the letters in an        capitalize
transform element                             uppercase
                                              lowercase
                                              normal
unicode-
                                              embed
bidi
                                              bidi-override
                                              baseline
vertical-   Sets the vertical alignment of sub
align       an element                        super
                                              top
text-top
                                             middle
                                             bottom
                                             text-bottom
                                             length
                                             %
                                             normal
white-        Sets how white space inside an
                                             pre
space         element is handled
                                             nowrap
word-         Increase or decrease the space normal
spacing       between words                  length




All CSS Font Properties
The number in the "CSS" column indicates in which CSS
version the property is defined (CSS1 or CSS2).

Property        Description                Values
                                           font-style
                                           font-variant
                                           font-weight
                                           font-size/line-height
                                           font-family
                Sets all the font
                                           caption
font            properties in one
                                           icon
                declaration
                                           menu
                                           message-box
                                           small-caption
                                           status-bar
                                           inherit
                                           family-name
                Specifies the font family
font-family                                generic-family
                for text
                                           inherit
                                           xx-small
                Specifies the font size of x-small
font-size
                text                       small
                                           medium
large
                                          x-large
                                          xx-large
                                          smaller
                                          larger
                                          length
                                          %
                                          inherit
                                          normal
               Specifies the font style   italic
font-style
               for text                   oblique
                                          inherit
               Specifies whether or not
                                         normal
               a text should be
font-variant                             small-caps
               displayed in a small-caps
                                         inherit
               font
                                         normal
                                         bold
                                         bolder
                                         lighter
                                         100
                                         200
               Specifies the weight of a 300
font-weight
               font                      400
                                         500
                                         600
                                         700
                                         800
                                         900
                                         inherit




Styling Links
       a:link - a normal, unvisited link
       a:visited - a link the user has visited
       a:hover - a link when the user mouses over it
       a:active - a link the moment it is clicked
All CSS List Properties
The number in the "CSS" column indicates in which CSS
version the property is defined (CSS1 or CSS2).

Property      Description                   Values
                                            list-style-type
              Sets all the properties for a list-style-position
list-style
              list in one declaration       list-style-image
                                            inherit
                                            URL
list-style-   Specifies an image as the
                                            none
image         list-item marker
                                            inherit
              Specifies if the list-item    inside
list-style-
              markers should appear inside outside
position
              or outside the content flow inherit
                                            none
                                            disc
                                            circle
                                            square
                                            decimal
                                            decimal-leading-zero
                                            armenian
list-style-   Specifies the type of list-   georgian
type          item marker                   lower-alpha
                                            upper-alpha
                                            lower-greek
                                            lower-latin
                                            upper-latin
                                            lower-roman
                                            upper-roman
                                            inherit
All CSS Border Properties
The number in the "CSS" column indicates in which CSS
version the property is defined (CSS1 or CSS2).

Property      Description                     Values
              Sets all the border             border-width
border        properties in one               border-style
              declaration                     border-color
              Sets all the bottom border      border-bottom-width
border-bottom properties in one               border-bottom-style
              declaration                     border-bottom-color
border-       Sets the color of the
                                              border-color
bottom-color bottom border
border-       Sets the style of the
                                              border-style
bottom-style bottom border
border-       Sets the width of the
                                              border-width
bottom-width bottom border
                                              color_name
                                              hex_number
                Sets the color of the four
border-color                                  rgb_number
                borders
                                              transparent
                                              inherit
                Sets all the left border      border-left-width
border-left     properties in one             border-left-style
                declaration                   border-left-color
border-left-    Sets the color of the left
                                              border-color
color           border
border-left-    Sets the style of the left
                                              border-style
style           border
border-left-    Sets the width of the left
                                              border-width
width           border
                Sets all the right border     border-right-width
border-right    properties in one             border-right-style
                declaration                   border-right-color
border-right-   Sets the color of the right
                                              border-color
color           border
border-right-   Sets the style of the right
                                              border-style
style           border
border-right-   Sets the width of the right   border-width
width             border
                                               none
                                               hidden
                                               dotted
                                               dashed
                                               solid
                  Sets the style of the four
border-style                                   double
                  borders
                                               groove
                                               ridge
                                               inset
                                               outset
                                               inherit
                  Sets all the top border      border-top-width
border-top        properties in one            border-top-style
                  declaration                  border-top-color
border-top-       Sets the color of the top
                                               border-color
color             border
border-top-       Sets the style of the top
                                               border-style
style             border
border-top-       Sets the width of the top
                                               border-width
width             border
                                             thin
                                             medium
                  Sets the width of the four
border-width                                 thick
                  borders
                                             length
                                             inherit


All CSS Outline Properties
The number in the "CSS" column indicates in which CSS
version the property is defined (CSS1 or CSS2).

Property       Description                        Values
                                                  outline-color
               Sets all the outline properties in outline-style
outline
               one declaration                    outline-width
                                                  inherit
                                                  color_name
outline-
               Sets the color of an outline       hex_number
color
                                                  rgb_number
invert
                                           inherit
                                           none
                                           dotted
                                           dashed
                                           solid
outline-                                   double
           Sets the style of an outline
style                                      groove
                                           ridge
                                           inset
                                           outset
                                           inherit
                                           thin
                                           medium
outline-
           Sets the width of an outline    thick
width
                                           length
                                           inherit


All CSS Margin Properties
The number in the "CSS" column indicates in which CSS
version the property is defined (CSS1 or CSS2).

Property   Description                    Values
                                          margin-top
            A shorthand property for
                                          margin-right
margin      setting the margin properties
                                          margin-bottom
            in one declaration
                                          margin-left
                                          auto
margin-     Sets the bottom margin of an
                                          length
bottom      element
                                          %
                                          auto
            Sets the left margin of an
margin-left                               length
            element
                                          %
                                          auto
margin-     Sets the right margin of an
                                          length
right       element
                                          %
                                          auto
            Sets the top margin of an
margin-top                                length
            element
                                          %
All CSS Padding Properties
The number in the "CSS" column indicates in which CSS
version the property is defined (CSS1 or CSS2).

Property     Description                   Values
                                           padding-top
             A shorthand property for
                                           padding-right
padding      setting all the padding
                                           padding-bottom
             properties in one declaration
                                           padding-left
padding-     Sets the bottom padding of an length
bottom       element                       %
padding-     Sets the left padding of an   length
left         element                       %
padding-     Sets the right padding of an length
right        element                       %
padding-     Sets the top padding of an    length
top          element                       %


All CSS Dimension Properties
The number in the "CSS" column indicates in which CSS
version the property is defined (CSS1 or CSS2).

Property     Description                   Values
                                           auto
height       Sets the height of an element length
                                           % inherit
                                           none
             Sets the maximum height of an
max-height                                 length
             element
                                           % inherit
                                           none
             Sets the maximum width of an
max-width                                  length
             element
                                           % inherit
             Sets the minimum height of an length
min-height
             element                       % inherit
                                           length
             Sets the minimum width of an
min-width                                  %
             element
                                           inherit
auto
                                           length
width      Sets the width of an element
                                           %
                                           inherit


All CSS Positioning Properties
The number in the "CSS" column indicates in which CSS
version the property is defined (CSS1 or CSS2).

Property      Description               Values
                                        auto
              Sets the bottom margin length
bottom
              edge for a positioned box %
                                        inherit
                                        shape
              Clips an absolutely
clip                                    auto
              positioned element
                                        inherit
                                        url
                                        auto
                                        crosshair
                                        default
                                        pointer
                                        move
                                        e-resize
                                        ne-resize
              Specifies the type of
cursor                                  nw-resize
              cursor to be displayed
                                        n-resize
                                        se-resize
                                        sw-resize
                                        s-resize
                                        w-resize
                                        text
                                        wait
                                        help
                                        auto
              Sets the left margin edge length
left
              for a positioned box      %
                                        inherit
              Specifies what happens if auto
overflow
              content overflows an      hidden
element's box              scroll
                                         visible
                                         inherit
                                         absolute
              Specifies the type of      fixed
position      positioning for an         relative
              element                    static
                                         inherit
                                         auto
              Sets the right margin      length
right
              edge for a positioned box %
                                         inherit
                                         auto
              Sets the top margin edge length
top
              for a positioned box       %
                                         inherit
                                         number
              Sets the stack order of an
z-index                                  auto
              element
                                         inherit


All CSS Float Properties
The number in the "CSS" column indicates in which CSS
version the property is defined (CSS1 or CSS2).

Property      Description               Values
                                        left
              Specifies which sides of
                                        right
              an element where other
clear                                   both
              floating elements are not
                                        none
              allowed
                                        inherit
                                        left
              Specifies whether or not right
float
              a box should float        none
                                        inherit
Center Aligning Using the margin
Property
Block elements can be aligned by setting the left and right
margins to "auto".

Note: Using margin:auto will not work in Internet Explorer,
unless a !DOCTYPE is declared.

Setting the left and right margins to auto specifies that they
should split the available margin equally. The result is a
centered element:


Example
.center
{
margin-left:auto;
margin-right:auto;
width:70%;
background-color:#b0e0e6;
}

Tip: Aligning has no effect if the width is 100%.

Note: In IE 5 there is a margin handling bug for block
elements. To make the example above work in IE5, add
some extra code.




Left and Right Aligning Using the
position Property
One method of aligning elements is to use absolute
positioning:
Example
.right
{position:absolute;
right:0px;
width:300px;
background-color:#b0e0e6;}



Note: Absolute positioned elements are removed from the
normal flow, and can overlap elements.




Crossbrowser Compatibility Issues
When aligning elements like this, it is always a good idea to
predefine margin and padding for the <body> element. This
is to avoid visual differences in different browsers.

There is also another problem with IE when using the
position property. If a container element (in our case <div
class="container">) has a specified width, and the !DOCTYPE
declaration is missing, IE will add a 17px margin on the right
side. This seems to be space reserved for a scrollbar. Always
set the !DOCTYPE declaration when using the position
property:

Example

Body {margin:0; padding:0;}

.container {position:relative; width:100%;}

.right {position:absolute; right:0px; width:300px;
background-color:#b0e0e6;}
Left and Right Aligning Using the float
Property
One method of aligning elements is to use the float
property:


Example
.right
{float:right;
width:300px;
background-color:#b0e0e6;
}




Crossbrowser Compatibility Issues
When aligning elements like this, it is always a good idea to
predefine margin and padding for the <body> element. This
is to avoid visual differences in different browsers.

There is also another problem with IE when using the float
property. If the !DOCTYPE declaration is missing, IE will add
a 17px margin on the right side. This seems to be space
reserved for a scrollbar. Always set the !DOCTYPE
declaration when using the float property:


Example
body
{
margin:0;
padding:0;
}
.right
{float:right;
width:300px;
background-color:#b0e0e6;}
Creating a Transparent Image

<img src="klematis.jpg" width="150" height="113"
alt="klematis"
style="opacity:0.4;filter:alpha(opacity=40)" />

Weitere ähnliche Inhalte

Andere mochten auch

Computer past 1
Computer past 1Computer past 1
Computer past 1krudeaw
 
แหล่งโบราณคดีบ้านโป่งมะนาว [โหมดความเข้ากันได้]
แหล่งโบราณคดีบ้านโป่งมะนาว [โหมดความเข้ากันได้]แหล่งโบราณคดีบ้านโป่งมะนาว [โหมดความเข้ากันได้]
แหล่งโบราณคดีบ้านโป่งมะนาว [โหมดความเข้ากันได้]krudeaw
 
SIS Mid Review Report - 2012
SIS Mid Review Report - 2012SIS Mid Review Report - 2012
SIS Mid Review Report - 2012Anuja Herath
 
ใบความรู้ เรื่องการประมวลผลข้อมูลในชีวิตประจำวัน
ใบความรู้ เรื่องการประมวลผลข้อมูลในชีวิตประจำวันใบความรู้ เรื่องการประมวลผลข้อมูลในชีวิตประจำวัน
ใบความรู้ เรื่องการประมวลผลข้อมูลในชีวิตประจำวันเจ้าหญิง เจ้าหญิง
 
Computer past 1
Computer past 1Computer past 1
Computer past 1krudeaw
 
Training presentation vlookup - what it is, and when to use it
Training presentation   vlookup - what it is, and when to use itTraining presentation   vlookup - what it is, and when to use it
Training presentation vlookup - what it is, and when to use ithayat25in
 
Mobile Bill Management System - Project Proposal
Mobile Bill Management System - Project ProposalMobile Bill Management System - Project Proposal
Mobile Bill Management System - Project ProposalAnuja Herath
 

Andere mochten auch (16)

เรื่อง อาหารภาคเหนือ
เรื่อง อาหารภาคเหนือเรื่อง อาหารภาคเหนือ
เรื่อง อาหารภาคเหนือ
 
J Meter Intro
J Meter IntroJ Meter Intro
J Meter Intro
 
Special Report 10 Keys
Special Report 10 KeysSpecial Report 10 Keys
Special Report 10 Keys
 
First interview
First interviewFirst interview
First interview
 
Computer past 1
Computer past 1Computer past 1
Computer past 1
 
แหล่งโบราณคดีบ้านโป่งมะนาว [โหมดความเข้ากันได้]
แหล่งโบราณคดีบ้านโป่งมะนาว [โหมดความเข้ากันได้]แหล่งโบราณคดีบ้านโป่งมะนาว [โหมดความเข้ากันได้]
แหล่งโบราณคดีบ้านโป่งมะนาว [โหมดความเข้ากันได้]
 
Health Care Oriented Resume2011
Health Care Oriented Resume2011Health Care Oriented Resume2011
Health Care Oriented Resume2011
 
Atwood
AtwoodAtwood
Atwood
 
SIS Mid Review Report - 2012
SIS Mid Review Report - 2012SIS Mid Review Report - 2012
SIS Mid Review Report - 2012
 
ใบความรู้ เรื่องการประมวลผลข้อมูลในชีวิตประจำวัน
ใบความรู้ เรื่องการประมวลผลข้อมูลในชีวิตประจำวันใบความรู้ เรื่องการประมวลผลข้อมูลในชีวิตประจำวัน
ใบความรู้ เรื่องการประมวลผลข้อมูลในชีวิตประจำวัน
 
Computer past 1
Computer past 1Computer past 1
Computer past 1
 
ประวัติคอมพิวเตอร์ทดลอง
ประวัติคอมพิวเตอร์ทดลองประวัติคอมพิวเตอร์ทดลอง
ประวัติคอมพิวเตอร์ทดลอง
 
Active & passive
Active & passiveActive & passive
Active & passive
 
Training presentation vlookup - what it is, and when to use it
Training presentation   vlookup - what it is, and when to use itTraining presentation   vlookup - what it is, and when to use it
Training presentation vlookup - what it is, and when to use it
 
1
11
1
 
Mobile Bill Management System - Project Proposal
Mobile Bill Management System - Project ProposalMobile Bill Management System - Project Proposal
Mobile Bill Management System - Project Proposal
 

Kürzlich hochgeladen

The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
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
 
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
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
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
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
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
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
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
 
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
 

Kürzlich hochgeladen (20)

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
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
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
 
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
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
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
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
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
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
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
 
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
 

CSS Cheatsheet

  • 1. CSS Reference Anuja Madushan | www.anujalk.info
  • 2. All CSS Background Properties The number in the "CSS" column indicates in which CSS version the property is defined (CSS1 or CSS2). Property Description Values background-color Sets all the background-image background background-repeat background properties in one background-attachment declaration background-position inherit Sets whether a scroll background- background image is fixed attachment fixed or scrolls with inherit the rest of the page color-rgb color-hex Sets the background background-color color-name color of an element transparent inherit Sets the background url(URL) background- image for an none image element inherit left top left center left bottom right top right center Sets the starting background- right bottom position of a position center top background image center center center bottom x% y% xpos ypos inherit repeat Sets if/how a repeat-x background- background image repeat-y repeat will be repeated no-repeat inherit
  • 3. All CSS Text Properties The number in the "CSS" column indicates in which CSS version the property is defined (CSS1 or CSS2). Property Description Values color Sets the color of a text color ltr direction Sets the text direction rtl normal number line-height Sets the distance between lines length % letter- Increase or decrease the space normal spacing between characters length left right text-align Aligns the text in an element center justify none underline text- Adds decoration to text overline decoration line-through blink Indents the first line of text in length text-indent an element % none text- color shadow length none text- Controls the letters in an capitalize transform element uppercase lowercase normal unicode- embed bidi bidi-override baseline vertical- Sets the vertical alignment of sub align an element super top
  • 4. text-top middle bottom text-bottom length % normal white- Sets how white space inside an pre space element is handled nowrap word- Increase or decrease the space normal spacing between words length All CSS Font Properties The number in the "CSS" column indicates in which CSS version the property is defined (CSS1 or CSS2). Property Description Values font-style font-variant font-weight font-size/line-height font-family Sets all the font caption font properties in one icon declaration menu message-box small-caption status-bar inherit family-name Specifies the font family font-family generic-family for text inherit xx-small Specifies the font size of x-small font-size text small medium
  • 5. large x-large xx-large smaller larger length % inherit normal Specifies the font style italic font-style for text oblique inherit Specifies whether or not normal a text should be font-variant small-caps displayed in a small-caps inherit font normal bold bolder lighter 100 200 Specifies the weight of a 300 font-weight font 400 500 600 700 800 900 inherit Styling Links  a:link - a normal, unvisited link  a:visited - a link the user has visited  a:hover - a link when the user mouses over it  a:active - a link the moment it is clicked
  • 6. All CSS List Properties The number in the "CSS" column indicates in which CSS version the property is defined (CSS1 or CSS2). Property Description Values list-style-type Sets all the properties for a list-style-position list-style list in one declaration list-style-image inherit URL list-style- Specifies an image as the none image list-item marker inherit Specifies if the list-item inside list-style- markers should appear inside outside position or outside the content flow inherit none disc circle square decimal decimal-leading-zero armenian list-style- Specifies the type of list- georgian type item marker lower-alpha upper-alpha lower-greek lower-latin upper-latin lower-roman upper-roman inherit
  • 7. All CSS Border Properties The number in the "CSS" column indicates in which CSS version the property is defined (CSS1 or CSS2). Property Description Values Sets all the border border-width border properties in one border-style declaration border-color Sets all the bottom border border-bottom-width border-bottom properties in one border-bottom-style declaration border-bottom-color border- Sets the color of the border-color bottom-color bottom border border- Sets the style of the border-style bottom-style bottom border border- Sets the width of the border-width bottom-width bottom border color_name hex_number Sets the color of the four border-color rgb_number borders transparent inherit Sets all the left border border-left-width border-left properties in one border-left-style declaration border-left-color border-left- Sets the color of the left border-color color border border-left- Sets the style of the left border-style style border border-left- Sets the width of the left border-width width border Sets all the right border border-right-width border-right properties in one border-right-style declaration border-right-color border-right- Sets the color of the right border-color color border border-right- Sets the style of the right border-style style border border-right- Sets the width of the right border-width
  • 8. width border none hidden dotted dashed solid Sets the style of the four border-style double borders groove ridge inset outset inherit Sets all the top border border-top-width border-top properties in one border-top-style declaration border-top-color border-top- Sets the color of the top border-color color border border-top- Sets the style of the top border-style style border border-top- Sets the width of the top border-width width border thin medium Sets the width of the four border-width thick borders length inherit All CSS Outline Properties The number in the "CSS" column indicates in which CSS version the property is defined (CSS1 or CSS2). Property Description Values outline-color Sets all the outline properties in outline-style outline one declaration outline-width inherit color_name outline- Sets the color of an outline hex_number color rgb_number
  • 9. invert inherit none dotted dashed solid outline- double Sets the style of an outline style groove ridge inset outset inherit thin medium outline- Sets the width of an outline thick width length inherit All CSS Margin Properties The number in the "CSS" column indicates in which CSS version the property is defined (CSS1 or CSS2). Property Description Values margin-top A shorthand property for margin-right margin setting the margin properties margin-bottom in one declaration margin-left auto margin- Sets the bottom margin of an length bottom element % auto Sets the left margin of an margin-left length element % auto margin- Sets the right margin of an length right element % auto Sets the top margin of an margin-top length element %
  • 10. All CSS Padding Properties The number in the "CSS" column indicates in which CSS version the property is defined (CSS1 or CSS2). Property Description Values padding-top A shorthand property for padding-right padding setting all the padding padding-bottom properties in one declaration padding-left padding- Sets the bottom padding of an length bottom element % padding- Sets the left padding of an length left element % padding- Sets the right padding of an length right element % padding- Sets the top padding of an length top element % All CSS Dimension Properties The number in the "CSS" column indicates in which CSS version the property is defined (CSS1 or CSS2). Property Description Values auto height Sets the height of an element length % inherit none Sets the maximum height of an max-height length element % inherit none Sets the maximum width of an max-width length element % inherit Sets the minimum height of an length min-height element % inherit length Sets the minimum width of an min-width % element inherit
  • 11. auto length width Sets the width of an element % inherit All CSS Positioning Properties The number in the "CSS" column indicates in which CSS version the property is defined (CSS1 or CSS2). Property Description Values auto Sets the bottom margin length bottom edge for a positioned box % inherit shape Clips an absolutely clip auto positioned element inherit url auto crosshair default pointer move e-resize ne-resize Specifies the type of cursor nw-resize cursor to be displayed n-resize se-resize sw-resize s-resize w-resize text wait help auto Sets the left margin edge length left for a positioned box % inherit Specifies what happens if auto overflow content overflows an hidden
  • 12. element's box scroll visible inherit absolute Specifies the type of fixed position positioning for an relative element static inherit auto Sets the right margin length right edge for a positioned box % inherit auto Sets the top margin edge length top for a positioned box % inherit number Sets the stack order of an z-index auto element inherit All CSS Float Properties The number in the "CSS" column indicates in which CSS version the property is defined (CSS1 or CSS2). Property Description Values left Specifies which sides of right an element where other clear both floating elements are not none allowed inherit left Specifies whether or not right float a box should float none inherit
  • 13. Center Aligning Using the margin Property Block elements can be aligned by setting the left and right margins to "auto". Note: Using margin:auto will not work in Internet Explorer, unless a !DOCTYPE is declared. Setting the left and right margins to auto specifies that they should split the available margin equally. The result is a centered element: Example .center { margin-left:auto; margin-right:auto; width:70%; background-color:#b0e0e6; } Tip: Aligning has no effect if the width is 100%. Note: In IE 5 there is a margin handling bug for block elements. To make the example above work in IE5, add some extra code. Left and Right Aligning Using the position Property One method of aligning elements is to use absolute positioning:
  • 14. Example .right {position:absolute; right:0px; width:300px; background-color:#b0e0e6;} Note: Absolute positioned elements are removed from the normal flow, and can overlap elements. Crossbrowser Compatibility Issues When aligning elements like this, it is always a good idea to predefine margin and padding for the <body> element. This is to avoid visual differences in different browsers. There is also another problem with IE when using the position property. If a container element (in our case <div class="container">) has a specified width, and the !DOCTYPE declaration is missing, IE will add a 17px margin on the right side. This seems to be space reserved for a scrollbar. Always set the !DOCTYPE declaration when using the position property: Example Body {margin:0; padding:0;} .container {position:relative; width:100%;} .right {position:absolute; right:0px; width:300px; background-color:#b0e0e6;}
  • 15. Left and Right Aligning Using the float Property One method of aligning elements is to use the float property: Example .right {float:right; width:300px; background-color:#b0e0e6; } Crossbrowser Compatibility Issues When aligning elements like this, it is always a good idea to predefine margin and padding for the <body> element. This is to avoid visual differences in different browsers. There is also another problem with IE when using the float property. If the !DOCTYPE declaration is missing, IE will add a 17px margin on the right side. This seems to be space reserved for a scrollbar. Always set the !DOCTYPE declaration when using the float property: Example body { margin:0; padding:0; } .right {float:right; width:300px; background-color:#b0e0e6;}
  • 16. Creating a Transparent Image <img src="klematis.jpg" width="150" height="113" alt="klematis" style="opacity:0.4;filter:alpha(opacity=40)" />