CSS CheatSheet
CSS CheatSheet
INTRODUCTION TO CSS
2. Internal CSS: These CSS instructions are written directly into the
header of a specific .html page. This CSS style is an effective method of
styling a single page.
For example:
3. Inline CSS: Lastly, inline styles are CSS blocks that are written directly
into a single instance of HTML code.
For example:
type. When
utilising
@namespace,
universal
selectors can be
namespaced.
ID SELECTOR The CSS ID
selector
matches an
element based
on the value of id {}
the element’s id
attribute. This is
what you'd use
to refer to that
one- of-a-kind
element with an
id.
CLASS The CSS class
SELECTOR selector matches
elements based .class {}
on the contents
of their class.
2. seudo-classes and Pseudo-elements
A pseudo-class is used to define a special state of an element. A CSS
pseudo-element is used to style specified parts of an elemen
COMMANDS DESCRIPTION SYNTAX
selection to target
an element that a
user hovers over
with their cursor.
element or selects
it with the
keyboard's Tab
key.
Visited Represents that
Links the link has
Selecto already been :visited {}
r visited. Its styles
for URLs that the
user has already
visited are
defined.
Link This represents
Selector that the link has .class:link {}
not yet
3. CSS Text Styling
font-weight: normal
| bold | bolder |
4. CSS Table
Z Index Sets
overlapping
elements with
a larger z- z-index: 3 | auto | inherit
index cover
those with a
6. CSS Backgroun
7.
8.
9.
attribute controls
how the
background moves
in relation to the
viewport.
Background Set the
Color background colour background-color: #2AA9E0
of the div or
container.
Background Sets the position
Position of the
background-position: top |
ri
background.
Different properties and how it works:
Border
For example, in the following code,
utput:
columns are
in a grid
layout.
rows, and
areas.
the given
name on the
specified
element.
Counter Increases or
Increment decreases the
value of a CSS counter-increment:
name-of-counter
counter by a
given.
on its location
in a
document.