/* Background-Image: Sets the background image of an element */
background-image: url("clashingcode");
/* Background-Position: The position property is mainly used to specify the positioning of the image */
background-position: right top;
/* Background-Repeat: Defines how a specified background image is repeated. The repeat-x value will repeat the image horizontally(x-axis) while the repeat-y value will repeat the image vertically(y-axis) */
background-repeat: repeat-x;
/* Background-Attachment: specifies the kind of attachment of the background image(scroll with the content or be fixed respect the container). */
background-attachment: scroll;
/* Background-Color: Sets the background color of an element */
background-color: blue;
/* Background: Shorthand Property */
background: background-color background-image background-repeat background-attachment background-position;
body {
background: lightblue url("img_tree.gif") no-repeat fixed center;
}
body {
height: 100vh;
background: url(relative path or url in double quotes) | linear-gradient()
background-size: cover | contain | any unit value e.g. 1500px;
background-attachment: fixed | local | scroll;
background-position: x-offset(values:left,center,right) y-offset(values:top,center,bottom);
/* or single value for both x & y-offset */
background-repeat: repeat (enabled by default) | no-repeat;
/* some of them will only work provided height of the container */
/* That's pretty much it folks */
/* I can't cover details of each value. You'd have to search it */
}
/*This is an example*/
.example {
background: url("Yeet");
}
Code Example |
---|
Css :: conic gradient in css |
Css :: javafx button padding css |
Css :: text-transform |
Css :: use svg icon to before after |
Css :: had to add a tint to a picture on css |
Css :: add textcontent on hover |
Css :: how to space out buttons css |
Css :: css if element is empty |
Css :: css position absolute transition |
Css :: css background text clip |
Css :: css noise filter |
Css :: change image color in bootstrap card on hover css |
Css :: display in css |
Css :: css row column grid |
Css :: sass table |
Css :: Capitalise all first letters of words in a sentence with css |
Css :: css make ul on multiple lines |
Css :: center div |
Css :: css set text color |
Css :: style button for safari |
Css :: css select alternate elements |
Css :: last child of last child tailwind |
Css :: css file path |
Css :: how to apply css when not on hover |
Css :: image overlay css |
Css :: scss global class |
Css :: css chamfered corner |
Css :: em in css |
Css :: flip something css |
Css :: material design css |