All CSS
All CSS
element,element,.. div, p Selects all <div> elements and all <p> elements
Transparency
div {
background-color: green;
opacity: 0.3;
}
CSS background-attachment
Specify that the background image should be fixed:
body {
background-image: url("img_tree.png");
background-repeat: no-repeat;
background-position: right top;
background-attachment: fixed;
}
Specify that the background image should scroll with the rest of the page:
body {
background-image: url("img_tree.png");
background-repeat: no-repeat;
background-position: right top;
background-attachment: scroll;}
When using the shorthand property the order of the property values is:
background-color
background-image
background-repeat
background-attachment
background-position
Result:
A dotted border.
A dashed border.
A solid border.
A double border.
No border.
A hidden border.
A mixed border.
border-radius Sets all the four border-*-radius properties for rounded corners
margin A shorthand property for setting all the margin properties in one decla
<script src="https://kit.fontawesome.com/yourcode.js"
crossorigin="anonymous"></script>
Read more about how to get started with Font Awesome in our Font Awesome 5 tutorial.
Example
<!DOCTYPE html>
<html>
<head>
<script src="https://kit.fontawesome.com/a076d05399.js" crossorigin="anonym
ous"></script>
</head>
<body>
</body>
</html>
Result:
Styling Links
a {
color: hotpink;
}
In addition, links can be styled differently depending on what state they are in.
Example
/* unvisited link */
a:link {
color: red;
}
/* visited link */
a:visited {
color: green;
}
/* selected link */
a:active {
color: blue;
}
This example demonstrates the different types of cursors (can be useful for links):
CSS Property
Property Description
overflow-wrap Specifies whether or not the browser can break lines with long wo
container
overflow-x Specifies what to do with the left/right edges of the content if it ov
area
element element div p Selects all <p> elements inside <div> elements
element>element div > p Selects all <p> elements where the parent is a <div> e
element+element div + p Selects the first <p> element that are placed immediat
:first-of-type p:first-of-type Selects every <p> element that is the first <
:last-of-type p:last-of-type Selects every <p> element that is the last <
:only-of-type p:only-of-type Selects every <p> element that is the only <
Example
img {
opacity: 0.5;
}
img:hover {
opacity: 1.0;
}
[attribute~=value] [title~="flower"] Selects all elements with a title attribute that contains
of which is "flower"
[attribute|=value] [lang|="en"] Selects all elements with a lang attribute value starting
[attribute^=value] a[href^="https"] Selects all <a> elements with a href attribute value sta
[attribute$=value] a[href$=".pdf"] Selects all <a> elements with a href attribute value en
[attribute*=value] a[href*="w3schools"] Selects all <a> elements with a href attribute value co
content Used with the ::before and ::after pseudo-elements, to insert generate
border-image-outset Specifies the amount by which the border image area ext
Function Description
Property Description
Property Description
word-wrap Allows long words to be able to be broken and wrap onto the
Property Description
translate(x,y) Defines a 2D translation, moving the element along the X- and the
Property Description
backface-visibility Defines whether or not an element should be visible when not facin
translateX(x) Defines a 3D translation, using only the value for the X-axis
translateY(y) Defines a 3D translation, using only the value for the Y-axis
translateZ(z) Defines a 3D translation, using only the value for the Z-axis
Property Description
transition-property Specifies the name of the CSS property the transition effect is fo
transition-timing-function Specifies the speed curve of the transition effect
Property Description
animation-fill-mode Specifies a style for the element when the animation is not p
it ends, or both)
Property Description
mask-origin Specifies the origin position (the mask position area) of a mask
mask-position Sets the starting position of a mask layer image (relative to the
Property Description
Property Description