CSS Cheat Sheet
Complete CSS properties reference guide
CSS Cheat Sheet
Quick reference guide for CSS properties and selectors. Click the copy button to copy any command.
107
Total Commands
107
Filtered Results
Selectors
| Command | Copy | Description |
|---|---|---|
* | Universal selector | |
element | Element selector | |
.class | Class selector | |
#id | ID selector | |
element.class | Element with class | |
element, element | Multiple selectors | |
element element | Descendant selector | |
element > element | Child selector | |
element + element | Adjacent sibling | |
element ~ element | General sibling | |
[attribute] | Attribute selector | |
[attribute="value"] | Attribute with value | |
:hover | Hover pseudo-class | |
:active | Active pseudo-class | |
:focus | Focus pseudo-class | |
::before | Before pseudo-element | |
::after | After pseudo-element |
Display
| Command | Copy | Description |
|---|---|---|
display: block | Block display | |
display: inline | Inline display | |
display: inline-block | Inline-block display | |
display: flex | Flexbox display | |
display: grid | Grid display | |
display: none | Hide element |
Position
| Command | Copy | Description |
|---|---|---|
position: static | Default positioning | |
position: relative | Relative positioning | |
position: absolute | Absolute positioning | |
position: fixed | Fixed positioning | |
position: sticky | Sticky positioning | |
top: 0 | Top position | |
right: 0 | Right position | |
bottom: 0 | Bottom position | |
left: 0 | Left position | |
z-index: 10 | Z-index stacking |
Box Model
| Command | Copy | Description |
|---|---|---|
width: 100px | Set width | |
height: 100px | Set height | |
max-width: 100% | Maximum width | |
min-height: 100vh | Minimum height | |
margin: 10px | All margins | |
padding: 10px | All padding | |
border: 1px solid black | Border shorthand | |
box-sizing: border-box | Include padding in width |
Colors
| Command | Copy | Description |
|---|---|---|
color: red | Text color | |
background-color: blue | Background color | |
opacity: 0.5 | Opacity | |
color: rgb(255, 0, 0) | RGB color | |
color: rgba(255, 0, 0, 0.5) | RGBA color with alpha | |
color: #ff0000 | Hex color | |
color: hsl(0, 100%, 50%) | HSL color |
Typography
| Command | Copy | Description |
|---|---|---|
font-family: Arial, sans-serif | Font family | |
font-size: 16px | Font size | |
font-weight: bold | Font weight | |
font-style: italic | Font style | |
text-align: center | Text alignment | |
text-decoration: underline | Text decoration | |
text-transform: uppercase | Text transform | |
line-height: 1.5 | Line height | |
letter-spacing: 2px | Letter spacing | |
word-spacing: 5px | Word spacing |
Background
| Command | Copy | Description |
|---|---|---|
background-image: url("image.jpg") | Background image | |
background-repeat: no-repeat | No repeat | |
background-position: center | Background position | |
background-size: cover | Cover background | |
background-attachment: fixed | Fixed background | |
background: linear-gradient(to right, red, blue) | Linear gradient |
Borders
| Command | Copy | Description |
|---|---|---|
border-width: 2px | Border width | |
border-style: solid | Border style | |
border-color: black | Border color | |
border-radius: 10px | Rounded corners | |
border-top: 1px solid black | Top border only |
Shadows
| Command | Copy | Description |
|---|---|---|
box-shadow: 2px 2px 5px rgba(0,0,0,0.3) | Box shadow | |
text-shadow: 1px 1px 2px black | Text shadow |
Transforms
| Command | Copy | Description |
|---|---|---|
transform: translate(10px, 20px) | Move element | |
transform: rotate(45deg) | Rotate element | |
transform: scale(1.5) | Scale element | |
transform: skew(10deg, 20deg) | Skew element | |
transform-origin: center | Transform origin |
Transitions
| Command | Copy | Description |
|---|---|---|
transition: all 0.3s ease | Transition all properties | |
transition-property: opacity | Transition property | |
transition-duration: 0.5s | Transition duration | |
transition-timing-function: ease-in | Timing function | |
transition-delay: 0.2s | Transition delay |
Animations
| Command | Copy | Description |
|---|---|---|
@keyframes animationName { } | Define keyframes | |
animation: name 2s infinite | Animation shorthand | |
animation-name: slideIn | Animation name | |
animation-duration: 2s | Animation duration | |
animation-iteration-count: infinite | Animation iteration |
Flexbox
| Command | Copy | Description |
|---|---|---|
justify-content: center | Justify content | |
align-items: center | Align items | |
flex-direction: column | Flex direction | |
flex-wrap: wrap | Flex wrap | |
flex: 1 | Flex grow |
Grid
| Command | Copy | Description |
|---|---|---|
grid-template-columns: repeat(3, 1fr) | Grid columns | |
grid-template-rows: 100px auto | Grid rows | |
grid-gap: 10px | Grid gap | |
grid-column: span 2 | Column span | |
grid-row: span 2 | Row span |
Overflow
| Command | Copy | Description |
|---|---|---|
overflow: hidden | Hide overflow | |
overflow: scroll | Scroll overflow | |
overflow: auto | Auto overflow | |
overflow-x: hidden | Hide horizontal overflow |
Visibility
| Command | Copy | Description |
|---|---|---|
visibility: hidden | Hide element (keeps space) | |
visibility: visible | Show element |
Cursor
| Command | Copy | Description |
|---|---|---|
cursor: pointer | Pointer cursor | |
cursor: not-allowed | Not-allowed cursor | |
cursor: move | Move cursor |
Media Queries
| Command | Copy | Description |
|---|---|---|
@media (max-width: 768px) { } | Mobile media query | |
@media (min-width: 768px) { } | Desktop media query |
All operations are performed locally in your browser. No data is sent to any server.
About CSS Cheat Sheet
This section will contain detailed, SEO-friendly content about the CSS Cheat Sheet.
In the future, this content will be managed through a headless CMS, allowing you to:
- Add detailed explanations about how to use this tool
- Include examples and use cases
- Provide tips and best practices
- Add FAQs and troubleshooting guides
- Update content without touching the code
How to Use
Step-by-step instructions for using the CSS Cheat Sheet will appear here. This content will be fully customizable through the admin panel.
Features
Key features and benefits of this tool will be listed here. All content is editable via the CMS.