Css3 Cheatsheet



  • CSS Cheat sheet
    • 6. Box Model
  1. Css Properties Cheat Sheet
  2. Css And Html Cheat Sheet
  3. Css3 Cheatsheet Pdf
  4. Css3 Cheat Sheet Pdf
  5. Css3 Cheat Sheet

0 Comments for this cheatsheet. Devhints.io / Over 352 curated cheatsheets, by developers for developers. Devhints home Other CSS cheatsheets. Sass cheatsheet CSS flexbox cheatsheet CSS system fonts cheatsheet cssnext cheatsheet Stylus cheatsheet Bootstrap cheatsheet Top cheatsheets.

CSS stands for Cascading Style Sheets. The documents written in HTML are formatted and presented using CSS. There are many features in HTML and CSS is the most popular addition to it. Rather than changing the web page itself, with CSS, only the styles need to be changed, which means fewer chances to the overall code. Further, HTML contained a lot of repeated code for each web page, which can be put in a common file with CSS and used across web pages. CSS contains – selector and declaration block. A declaration block consists of property-value pairs. Example,

Developers often use HTML And CSS Cheat Sheets during the workflow. It is pretty hard to remember each and every element of CSS or HTML so keeping a reference is always good. Cheat sheets are the best reference aid for your workflow. These cheats contain the fundamental elements like HTML tags, CSS values and properties. CSS3 Cheat Sheet + PDF. There’s a lot of terms and technical tags in CSS that aren’t easy to recall off the top of your head. Even experts will forget them from time-to-time. Now, you don’t have to worry anymore! This cheat sheet will be ready and waiting for you in your bookmarks for those times when you need a reminder.

Here, title is the selector and the declaration block is the entire thing inside the curly braces. Saved as - .css file

CSS Cheat sheet

1. Font

PropertyValuesExample
font-stylenormal/italic/inherit/obliquefont-style: normal
font-variantnormal/inherit/small-capsfont-variant: small-caps
font-weightnormal/bold/bolder/lighter/100-900/inheritfont-weight:bold
font-size?px/?%/small/medium/largefont-size: large font-size :5
font-familyverdana/calibri.. etc…font-family: verdana

2. Text

PropertyValuesExample
text-alignleft/right/center/justifytext-align: justify;
letter spacingnormal/length/?%letter spacing : 3%;
Text-outlineNone/length/colorText-outline: red
word-wrapnormal/lengthword-wrap: normal;
directionltr/rtl/inheritDirection: ltr;
text-wrapnormal/unrestricted/nonetext-wrap: normal
text-indent?%/?pxtext-indent: 2%
word-spacingnormal/?%/?pxword-spacing: normal
text-transformnone/uppercase/lowercase/capitalizetext-transform: lowercase
text-emphasisnone/dot/open/filled/circle/triangletext-emphasis: filled
text-justifyauto/distribute/inter-wordtext-justify:distribute

3. User Interface

PropertyValuesExample
appearance – apply platform specific stylingnormal | inherit | [icon | window | desktop | work-space | document | tooltip | dialog | button | push-button | hyperlink | radio-button | checkbox | menu-item | tab | menu | menubar | pull-down-menu | pop-up-menu | list-menu | radio-group | checkbox-group | outline-tree | range | field | combo-box | signature | password]appearance: password;
cursorauto | crosshair | default | pointer | move | e-resize | neresize | nw-resize | n-resize | se-resize | sw-resize | swresize | s-resize | w-resize | text | wait | help.help { cursor: help; }
nav-index - specifies the sequential navigation order of current element. Similar to tab index in html. Values can be auto or a positive number representing the navigation order. First value is 1.auto | inherit numbernav-index: 1;
nav-upauto | inherit <id> [current | root | <target-name> auto (browser decides where to navigate to)/ id (specific ID to be navigated to)/ target_name (target frame to navigate to)/inherit (value computed based on element’s parent; root or current)nav-up: auto;
nav-downauto | inherit <id> [current | root | <target-name>nav-down: #b2;
nav-leftauto | inherit <id> [current | root | <target-name>nav-left: #b1;
nav-rightauto | inherit <id> [current | root | <target-name>nav-right: #b2;
resizenone | both | horizontal | vertical | inheritresize: horizontal;
iconauto | inherit urlicon: url(“like.png”);

4. Backgrounds

PropertyValuesExample
background-sizeauto/cover/?px/?%background-size: cover
background-imageurl/nonebackground-image: none
background-repeatno-repeat/repeat-x/repeat-y/repeatbackground-repeat: repeat
background-attachmentfixed/scrollbackground-attachment: fixed
background-colorcolor/transparentbackground-color: white
background-positioncan be any position from different combinations like top left, top right, top center. Same with bottom. can be mentioned in terms of position x-% and y-%background-position: top-left;
background-originthe starting point of the backgroundbackground-origin: 0;
background-clip - lets you control how much of the background image should extend beyond the element’s content or paddingcontent-box/padding-box/border-box/no-clip/?%/?pxbackground-clip: no-clip

5. Borders

PropertyValuesExample
border-widththin/thick/medium/?pxborder-width: medium border-width: 20px
border-stylenone/dashed/dotted/inset/double/solidborder-style : dotted
border-colorname of the colorborder-color: black
border-left: border-left-color border-left-widthborder-left-color: black border-left-width : 10px
border-right: border-right-color border-right-widthborder-right-color : black border-right-width : 15px
border-top: border-top-width border-top-colorborder-top-width : 10px border-top-color : blue
border-bottom: border-bottom-color border-bottom-widthborder-bottom-color : black border-bottom-width : 15px
border-decoration-breakmaintain consistent design amongst fragments of broken element slice/cloneborder-decoration-break: slice;
border-radius border-top-right-radius border-bottom-right-radius border-bottom-left-radius border-top-left-radius?pxborder-top-left-radius : 20px
border-image?%/stretch/repeat/round/noneborder-image : repeat border-image : 12px

6. Box Model

PropertyValuesExample
floatleft | right | nonefloat : right
heightauto length %height : 10px
max-heightnone length %max-height : 10px
max-widthnone length %max-width : 120%
min-heightnone length %min-height : 50%
min-widthauto % lengthmin-width : 30px

6.1. Margin

PropertyValuesExample
margin-bottomauto/length %margin-bottom : 20px
margin-leftauto/height %margin-left : auto
margin-rightauto/height %margin-right : 30%
margin-topauto/length %margin-top : 40mm

6.2. Padding

PropertyValuesExample
padding-bottomlength %padding-bottom : 20px
padding-toplength %padding-top : 20px
padding-rightlength %padding-right : 20px
padding-leftlength %padding-left : 20px
displaynone/inline/block/inline-block/list-item/run-in/compact/table/inline-table/table-row-group/table-headergroup/table-footer-group/table-row/table-column-group/table-column/table-cell/table-caption/ruby/ruby-base/ruby-text/ruby-base-group/ruby-text-groupdisplay : inline
marquee-directionforward/reversemarquee-direction : forward
marquee-loopinfinite/integermarquee-loop : 10
marquee-play-countinfinite/integermarquee-play-count : 50
marquee-speedslow/normal/fastmarquee-speed : slow
marquee-stylescroll/slide/alternatemarquee-style : scroll
overflowvisible/hidden/scroll/auto/no-display/no-content/overflow-x/overflow-yoverflow : visible
overflow-styleauto/marquee-line/marquee-blockoverflow-style : auto
overflow-xvisible/hidden/scroll/auto/no-display/no-contentoverflow-x : scroll
rotationanglerotation : 20deg
rotation-pointposition (paired value off-set)rotation-point : 50% 50%
visibilityvisible/hidden/collapsevisibility: hidden
clearleft/right/both/noneclear: left

7. Template Layout

PropertyValuesExample
box-alignstart/end/center/basebox-align : start
box-directionnormal/reversebox-direction : normal
box-flexnormalbox-flex : normal
box-flex-groupintegerbox-flex-group : 2
box-linessingle/multiplebox-lines : single
box-orienthorizontal/vertical/inline-axis/block-axisbox-orient : inline
box-packstart/end/center/justifybox-pack : justify
box-sizingcontent-box/padding-box/border-box/margin-boxbox-sizing : margin-box
tab-sidetop/bottom/left/righttab-side : left

8. Table

PropertyPossible values
border-collapsecollapse/separate
empty-cellsshow/hide
border-spacing?%/?px
table-layoutauto/fixed
caption-sidetop/bottom/left/right

9. Columns

Css Properties Cheat Sheet

Css3 Cheatsheet
PropertyValuesExample
column-countauto/numbercolumn-count : 10
column-fillauto/balance/balance-allcolumn-fill : balance
column-gapnormal/?pxcolumn-gap : 5px
column-rule-widththin/medium/thick/?pxcolumn-rule-width : medium column-rule-width : 2px
column-rule-styleborder-style – dotted/solid/hidden/double/ dashed/groove/hidden/inset/outset/inheritcolumn-rule-style : dotted
column-rule-colorcolorcolumn-rule-color : black
column-widthauto/?pxcolumn-width : 10px
column-span1/allcolumn-span : all

10. Colors

PropertyValuesExample
colorinherit/colorcolor : green
opacityinherit/number levelopacity : 4

11. Grid Positioning

PropertyValuesExample
grid-columnsnone/inherit/?px/?%/x%-y%grid-columns : 10px
grid-rowsnone/inherit/?px/?%/x%-y%grid-rows : 40%

12. List and Markers

PropertyValues
list-style-type

none/asterisks/box/check/circle/diamond/disc/hyphen/square/decimal/decimal-leading-zero/lower-roman/upper-roman/lower-alpha/upper-alpha/lower-greek/lower-latin/upper-latin/hebrew/armenian/georgian/cjk-ideographic/hiragana/katakana/hiragana-iroha/katakana-iroha/footnotes

Example:

{ list-style-type : upper-roman}

list-style-position

?%/?px

Example:

list-style-position : 20px

list-style-image

none/url

Example:

list-style-image : url(‘hackrhome.gif’);

marker-offset

auto/?px

Example:

marker-offset : auto

13. Animations

PropertyValuesExample
animation-namenone/IDanimation-name : myfirstanim
animation-durationtimeanimation-duration : 5s
animation-timing-functionease/linear/ease-in/easeout/ease-in-out/cubic-Bezier(number, number, number, number)animation-timing-function : linear;
animation-delaytimeanimation-delay : 5ms
animation-iteration-countinherit/numberanimation-iteration-count : 5
animation-directionnormal/alternateanimation-direction : alternate
animation-play-staterunning/pausedanimation-play-state : running
animation-fill-modeNone/backwards/ forwards/both/initial/inheritanimation-fill-mode : both

14. Outline

PropertyValuesExample
outline-colorColor nameoutline-color : green
outline-stylenone/dotted/dashed/solid/double/groove/ridge/inset/outsetoutline-style : solid
outline-widththin/medium/thick/?pxoutline-width : medium outline-width : 20px
outline-offsetinherit/?pxoutline-offset : 15px

15. Hyperlink

PropertyValuesExample
target-namecurrent/root/parent/new/modal/'string'target-name : parent
target-newtab/window/nonetarget-new : window
target-positionfront/back/above/behindtarget-position : front

16. Paged Media

PropertyValuesExample
fitfill/hidden/meet/slicefit : fill
fit-positiontop/center/bottom or left/center/right ?%/?pxfit-position : top 35%
orphansintegerorphans : 4
image-orientationauto/angle (deg/rad/turn/grad)image-orientation : 0grad
pageauto/idpage : auto
page-break-afterauto/always/avoid/left/rightpage-break-after : always
page-break-beforeauto/always/avoid/left/rightpage-break-before: left
page-break-insideauto/avoidpage-break-inside : avoid
sizeauto/landscape/portrait/?pxSize : landscape
windowsintegerWindows : 4

17. Positioning

PropertyValuesExample
bottom/right/top/leftauto/%/lengthbottom: 20% top : auto left : 40px right : 25px
z-indexauto/numberz-index : 2
clipshape/autoclip : auto
positionfixed/static/relative/absoluteposition : static

18. Transitions

PropertyValuesExample
transitions-delaytime (ms/s)transitions-delay : 20ms
transitions-durationtime (ms/s)transitions-duration : 2s
transitions-propertynone/alltransitions-property: none
transition-timing-functionease/linear/ease-in/ease-out/ease-in-out/cubicBezier(number, number, number, number)transition-timing-function: ease-in-out;

19. 3D / 2D Transform

PropertyValuesExample
backface-visibilityvisible/hiddenbackface-visibility : hidden
perspectivelength | none | initial | inheritperspective : 100px
perspective-origin[ [?%/?px/left/center/right ] [?%/?px/top/center/bottom ]] ?px ]/[ [ [ left/center/right ] or [ top/center/bottom ] ] ?px ]perspective-origin : 10px 30px perspective-origin : 10% 30% perspective-origin : left center;
transformnone/matrix/matrix3d/translate3d/tranlateX/translateY/translateZ/scale/
scale3d/scaleX/scaleY/scaleZ/rotate/rotate3d/rotateX/rotateY/rotateZ/
skewX/skewY/skew/perspective
transform: skewy(40deg); transform: scalex(10); transform: rotate(50deg);
transform-origin[ [ [ ?%/?px/left/center/right ] [ ?%/?px/top/center/bottom ]? ] <length> ]/[ [ [ left/center/right ] or [ top/center/bottom ] ] ?px ]transform-origin : 20% 50%; transform-origin : center; transform-origin : 20px 50px;
transform-styleflat/preserve-3dtransform-style : preserve-3d

21. Speech

PropertyValuesExample
cue-before – play a sound file before an elementurl [ silent | x-soft | soft | medium | loud | x-loud | none | inherit].voice;
cue-after - play a sound file after an elementurl [ silent | x-soft | soft | medium | loud | x-loud | none | inherit].voice;
pauseTimepause: 25ms
pause-before<time> | none | x-weak | weak | medium | strong | x-strongpause-before : 25ms
pause-after<time> | none | x-weak | weak | medium | strong | x-strongpause-after : 25ms
phonemes – give a phonetic pronunciation to elements<string>#computer
voice-stressnormal | strong | moderate | none | reducedvoice-stress : moderate;
voice-pitch<frequency> && absolute | [[x-low | low | medium | high | x-high] || [<frequency> | <semitones> | <percentage>]]voice-pitch: high; voice-pitch: 350hz; voice-pitch: 45%
voice-durationauto | <time>voice-duration: auto; voice-duration: 60s;
voice-volumesilent | [[x-soft | soft | medium | loud | x-loud] || <decibel>]voice-volume: 25db; voice-volume: silent; voice-volume: soft;
voice-family[[<name> | <generic-voice>],]* [<name> | <generic-voice>] | preserve <generic-voice> = [<age>? <gender> <integer>?]voice-family : “child”, “female”
voice-rate[normal | x-slow | slow | medium | fast | x-fast] || <percentage>voice-rate: slow; voice-rate: 30%;
speaknone | normal | spell-out | digits | literal-punctuation | no-punctuation | inherit-numberspeak : none;
caption-side – position for table captiontop | bottom | left | right | inheritcaption-side: left;
rest-before<time> | none | x-weak | weak | medium | strong | x-strongrest-before: medium; rest-before: 20ms;
rest-after<time> | none | x-weak | weak | medium | strong | x-strongrest-after: medium; rest-after: 20ms;

22. Pseudo-class

PropertyMeaning
:activethe active element
:focusElement in focus
:linkan unvisited link
:enabledan element when enabled
:disabledan element when disabled
:hoverelement when you mouse over
:checkedChecked element
:selection an element currently selected or highlighted by the user
:langallows the author to specify a language to use in a specified element
:nth-child(n)an element that is the nth sibling
:nth-last-child(n)an element that is the nth sibling counting from the last sibling
:first-childfirst sibling
:last-childlast sibling
:only-childonly child element
:nth-of-type(n)an element that is the n-th sibling of its type
:nth-last-of-type(n)n-th sibling of its type counting from the last sibling
:first-of-typefirst sibling of its type
:last-of-typean element that is the last sibling of its type
:only-of-typeonly child of its type
:emptyElement with no children
:rootRoot element of the document
:targetTarget specified by a URL
:not(x)element not represented by the argument ‘x’

23. Pseudo-element

Cheatsheet
PropertyMeaningExample
::first-letterAdds special style to the first letter of a textp::first-letter { font-size: 150%; color: #FFF00; }
::first-lineAdds special style to the first line of a textp::first-letter { font-size: 150%; color: black; }
::beforeInserts some content before an elementp::before { content: 'Welcome to hackr: '; }
::afterInserts some content after an elementp::after { content: 'Thank you for watching'; }

Absolute Measurements

SymbolRepresentation
%percentage
msmillisecond
ssecond
ininches
mmmillimetre
cmcentimetre
ptpoint (1/72 inch)
pcpica (12 points)

24. Angles/Time/Frequency

UnitRepresentation
degdegree
gradgradient
radradian
turnturns
msmillisecond
ssecond
Hzhertz
khzkilohertz

Css And Html Cheat Sheet

25. Relative measurement

UnitRepresentation
pxpixel of the device
gdgrid defined by layout-grid
emfont size of current element
remfont size of root element
exx-height of the element’s font
vhviewport height
vmviewport height or width (lower value)
vwviewport width

26. Selector types

TypeMeaningExample
classmultiple elements of various types.class
idsingle element#id
universalapplicable to all elements*
groupapply style to multiple elementsp h1 h2
typeelement of the specified typep
tree descendantelement that is below another (any level)# elementname h3
childelement one below the parent element# elementname > h3
sibling adjacent generaladjacent share the same parent and in the same immediate sequence general share the same parent but can be in any sequenceh2 + p h2 ~ p

27. Generated Content

PropertyValueExample
bookmark-labelContent/attr/label stringbookmark-label : “This is bookmark”
bookmark-levelNone/integerbookmark-level : 2;
bookmark-targetSelf/url/attrbookmark-target : url(http://hackr.io);
counter-resetNone/numbercounter-reset : 5
cropAuto/shapeCrop : auto
displaynone/inline/block/inline-blockDisplay : block;
contentnormal | none | inhibit urlContent : normal
float-offsetlength float-offset : 20px 20px
hyphenate-afterauto/integerhyphenate-after : 15
hyphensnone/auto/manualhyphens : manual
hyphenate-linesno-limit/integerhyphenate-lines : no-limit
hyphenate-resourcenone/urlhyphenate-resource : url(http://hackr.io)
hyphenate-beforeauto/integerhyphenate-before : 10
hyphenate-characterauto/stringhyphenate-character : “1234”
counter-incrementnone/numbercounter-increment : 10
markscrop | cross/nonemarks : crop
move-tonormal/here/idmove-to : normal
image-resolutionauto/normal/dpiimage-resolution : auto
page-policystart/first/lastpage-policy : last
quotesnone/stringquotes : “’” “’”
string-set[id string] [id string]string-set : header content();
text-replacenone [string string]text-replace : “foo” “bar”

28. Line Box

Css3 Cheatsheet Pdf

PropertyValueExample
alignment-adjustauto | baseline | before-edge | text-before-edge | middle | central | after-edge | textafter-edge | ideographic | alphabetic | hanging | mathematical length | %alignment-adjust : middle
alignment-baselinebaseline | ise-script | beforeedge | text-before-edge | afteredge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematicalalignment-baseline : hanging
drop-initial-after-aligncentral | middle | after-edge | text-after-edge | ideographic | alphabetic | mathematical | %drop-initial-after-align : 30%
drop-initial-before-aligncaps-height | <alignment-baseline>drop-initial-before-align : central
drop-initial-before-adjustbefore-edge | text-before-edge | central | middle | hanging | mathematical | length | %drop-initial-before-adjust : 10px drop-initial-before-adjust : 10% drop-initial-before-adjust : middle
drop-initial-valueinitial integerdrop-initial-value : 20
drop-initial-sizeauto integer % linedrop-initial-size : 25%
baseline-shiftsub | super | length %baseline-shift : super
dominant-baselinebaseline/hanging/middledominant-baseline : middle x=25 y = 50
line-stacking-shiftconsider-shifts | disregard-shiftsline-stacking-shift : disregard-shifts
line-stacking-strategyinline-line-height | block-line-height | max-height | grid-heightline-stacking-strategy: max-height
inline-box-alignInitial | last| integer inline-box-align : 2 inline-box-align : initial
line-heightNormal/number/ length/ %line-height : 30%
text-heightauto | font-size | text-size | max-sizetext-height : auto
vertical-alignBaseline | sub | super | top | text-top | middle | bottom | text-bottom length | %vertical-align : middle

Download CSS Cheat Sheet PDF

Conclusion

Css3 Cheat Sheet Pdf

With that comes to an end of the CSS cheat sheet. This you way can brush up your skills while you are creating a website or preparing for CSS interview. You may also want to read types of CSS and difference between CSS, CSS2, CSS3 to understand CSS better. You can live up your webpage with the CSS skills so go ahead and bright it up.

Css3 Cheat Sheet

People are also reading: