If you are using CSS for frontend web development, you may be interested in this article. The gist of the article is that you will be able to know all major CSS tags, their properties and their values.
Text
- text-align
.container {
text-align: justify;
}
left - Aligns the text to the left
right - Aligns the text to the right
center - Centers the text
justify - Stretches the lines so that each line has equal width (like in newspapers)
initial - Sets this property to its default value.
- text-decoration
h1 {
text-decoration: overline;
}
h2 {
text-decoration: line-through;
}
h3 {
text-decoration: underline;
}
h4 {
text-decoration: underline overline;
}
- text-transform
.container {
text-transform: uppercase | lowercase | capitalize;
}
none - No capitalization
capitalize - Transforms the first character of each word to uppercase
uppercase - All characters transform to uppercase
lowercase - All characters transform to lowercase
- text-indent
.container{
text-indent: 1cm;
}
- word-spacing
.container{
word-spacing: 0.9em;
}
Background Tags
- background-image
.container{
background-image: url("Path");
}
- background-position
.container{
background-position: right | top | bottom | left;
}
- background-size
.container{
background-size: cover;
}
auto - Default value. The background image is displayed in its original size
length - Sets the width and height of the background image. The first value sets the width, the second value sets the height. If only one value is given, the second is set to "auto". Read about length units
percentage - Sets the width and height of the background image in percent of the parent element. The first value sets the width, the second value sets the height. If only one value is given, the second is set to "auto"
cover - Resize the background image to cover the entire container, even if it has to stretch the image or cut a little bit off one of the edges
contain Resize the background image to make sure the image is fully visible.
(Source of information of parameters provided by : W3Schools)
- background-repeat The background-repeat property sets how the background image should be repeated.
.container{
background-repeat: repeat|repeat-x|repeat-y|no-repeat|initial|inherit;
}
- background-attachement The background-attachment property sets if an image scrolls with the the page, or fixed.
.container{
background-attachment: scroll|fixed|local|initial|inherit;
}
- background-color
.container{
background-color: white;
}
- background
.container{
background: color image repeat attachment position;
}
Border
- border-width
.container{
border-width: 30px;
}
- border-style
p.dotted {border-style: dotted;}
p.dashed {border-style: dashed;}
p.solid {border-style: solid;}
p.double {border-style: double;}
p.groove {border-style: groove;}
p.ridge {border-style: ridge;}
p.inset {border-style: inset;}
p.outset {border-style: outset;}
p.none {border-style: none;}
p.hidden {border-style: hidden;}
p.mix {border-style: dotted dashed solid double;}
dotted - Defines a dotted border
dashed - Defines a dashed border
solid - Defines a solid border
double - Defines a double border
groove - Defines a 3D grooved border. The effect depends on the border-color value
ridge - Defines a 3D ridged border. The effect depends on the border-color value
inset - Defines a 3D inset border. The effect depends on the border-color value
outset - Defines a 3D outset border. The effect depends on the border-color value
none - Defines no border
hidden - Defines a hidden border
- border-color
.container {
border-color: aqua;
}
- border-radius
.container{
border-radius: 18px;
}
Box model
- float
.container {
float: none;
}
- clear
.container {
clear: both;
}
- display
.container {
display: block | flex | inline;
}
- height
.container {
height: fit-content;
}
- width
.container {
width: auto;
}
- margin
.container {
margin: top right bottom left;
}
- padding
.container {
padding: top right bottom left;
}
- overflow
.container {
overflow: hidden;
}
- visibility
.container {
visibility: visible;
}
Colors
- color
.container{
color: black;
}
- opacity
.container{
opacity: 2;
}
Layout
- box-align
.container{
box-align: start;
}
- box-direction
.container{
box-direction: normal;
}
- box-flex
.container{
box-flex: normal;
}
- box-flex-group
.container{
box-flex-group: 3;
}
- box-orient
.container{
box-orient: inline;
}
- box-pack
.container{
box-pack: initial;
}
- box-sizing
.container{
box-sizing: border-box;
}
- max-width
.container{
max-width: 900px;
}
- min-width
.container{
min-width: 600px;
}
- max-height
.container{
max-height: 100px;
}
- min-height
.container{
min-height: 100vh;
}
Animations
- animation-name
.container{
animation-name: helloworld;
}
- animation-duration
.container{
animation-duration: 15s;
}
- animation-timing-function
.container{
animation-timing-function: ease-in;
}
- animation-delay
.container{
animation-delay: 25ms;
}
- animation-direction
.container{
animation-direction: normal;
}
- animation-iteration-count
animation-iteration-count property defines the number of times an animation should be played.
.container{
animation-iteration-count: 5;
}
- animation-play-state
.container{
animation-play-state : running;
}
- animation-fill-mode
.container{
animation-fill-mode : forwards;
}
Transition
- transition-property
.container{
transition-property: none;
}
- transition-duration
.container{
transition-duration: 3s;
}
- transition-delay
.container{
transition-delay: 30ms;
}
List
- list-style-type
.container{
list-style-type: none
}
- list-style-position
.container{
list-style-position: 25px;
}
- list-style-image
.container{
list-style-image: url("");
}
Flex
- order
.container{
order: 4;
}
- flex-grow
.container{
flex-grow: 4;
}
- flex-basis
.container{
flex-basis: auto;
}
- flex-shrink
.container{
flex-shrink: 4;
}
Grid
- justify-content
.container{
justify-content: start | end | center | stretch | space-around | space-between
}
- align-content
.container{
align-content: start | end | center | stretch | space-around | space-between
}
- align-items
.container{
align-items: start | end | center | stretch;
}
- justify-items
.container{
justify-items: start | end | center | stretch;
}
- justify-self
.container{
justify-self: start | end | center | stretch;
}
- align-self
.container{
justify-self: start | end | center | stretch;
}
- place-self
.container{
place-self: start | end | center | stretch;
}
Top comments (2)
This is by no means a complete list!
Yeah, its not full list but I have tried to cover up important tags 🙂