Css3 Cheatsheet



  1. Css3 Cheat Sheet
  2. Html5 And Css3 Cheat Sheet
  3. Html5 Css3 Cheat Sheet
  4. Css3 Cheat Sheets
  5. Css3 Cheat Sheet
  6. Html And Css Codes Pdf
  • CSS Cheat sheet
    • 6. Box Model

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,

Here, title is the selector and the declaration block is the entire thing inside the curly braces. Bmw x5 drivers door wont open from inside or outside. Saved as - .css file

CSS 3 cheat sheet. More Information on CSS 3 cheat sheet. Compatibility tables for support of CSS3. More Information on Compatibility tables for support of CSS3. Download CSS 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. The complete CSS cheat sheet PDF and PNG includes the latest CSS3 tags and attributes. Perfect for beginners and free to download! In this post we present a printable CSS 3 Cheat Sheet (PDF), a complete listing of all the properties, selectors types and allowed values in the current CSS 3 specification from the W3C. Each property is provided in a section that attempts to match it with the section (module) that it is most actively associated within the W3C specification.

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

Pdf
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

Css3 Cheat Sheet

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;
Css3 Cheatsheet

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

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

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

Css3 cheat sheet pdf
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

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
Css3 Cheatsheet

Download CSS Cheat Sheet PDF

Conclusion

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.

People are also reading:

How it works

The CSS3 Animation Cheat Sheet is a set of preset, plug-and-play animations for your web projects. All you need to do is add the stylesheet to your website and apply the premade CSS classes to the elements you want animated.

The CSS3 Animation Cheat Sheet uses CSS3 @keyframes and works on all the latest browsers (that's IE 10). Using CSS3 @keyframes, you don't have to worry about positioning the element to accomodate the animations - it will animate into place. Also for users with older browsers, the animated element will be visible and in place, even if the animation doesn't trigger. Below are instructions on how to get started.

Html5 And Css3 Cheat Sheet

Add the animation stylesheet to the <head> element of your webpage:

Replace css with the name of the directory where the animation stylesheet is.

Add an animation class to the element you want animated:

For entrance animations, you need to make them invisible by adding the visibility: hidden property to the animated element:

visibility: hidden; is used to hide elements before the animation is activated.

The values for these animations are relative to the element's size. That means bigger images have more exaggerated animations and smaller images have more subtle animations. While these animations are simple to implement, feel free to tweak values in the stylesheet to get the right effect.

Html5 Css3 Cheat Sheet

Adding effects

By default, these animations will trigger when the page loads - even if the element is further down the page - but by using jQuery there are many ways you can activate the animations. See how you can use these animations on your website.

Add jQuery to the <head> element of your webpage:

Add this before the </body> tag to trigger the animation when the user scrolls to the element:

Replace #animatedElement with the ID or class of the element you want animated.

Replace slideUp with an animation class.

400 represents the space between the element and the top of the screen. The animation activates when the element is 400px from the top of the screen. Increase this number to make the animaton activate sooner.

Css3 Cheat Sheets

Add this before the </body> tag to trigger the animation when the user clicks on the element:

Css3 Cheat Sheet

Replace #animatedElement with the ID or class of the element you want animated.

Html And Css Codes Pdf

Replace slideUp with an animation class.