css background

Solutions on MaxInterview for css background by the best coders in the world

showing results for - "css background"
Alina
26 Jan 2018
1 // change background color for specific id ..
2function changebackground(){
3	document.getElementById('id').style.backgroundColor = 'green' ; 
4}
5// change background color for whole body..
6function changebackground(){
7	document.body.style.backgroundColor = 'green';
8}
9 
Younes
28 Sep 2016
1li:last-child {
2    background-color: lime;
3}
Miranda
27 Oct 2016
1<!-- Code by Scratchy -->
2<!-- Twitter: @S_cratchy-->
3
4<head>
5  <style>
6    body {
7      background-image: url(https://wallup.net/wp-content/uploads/2019/09/110394-cats-grey-kittens-fluffy-fat-grass-animals-cat-kitten-baby-cute-748x468.jpg) 
8    }
9  </style>
10  
11  <body>
12    You have set the background image!
13    
14    
15    
16  </body>
Maya
26 Jul 2016
1body {
2 background-image: url("paper.gif");
3 background-color: #cccccc;
4}
Jessica
11 Oct 2020
1/* Use the following code: */
2html {background-color: #fefefe;} 
3/* You can change the hexedecimal code to RGB, RGBA, name & more colors!*/
Cristóbal
05 Jan 2019
1.my-div{
2  background-color: #00f; /* Blue */
3}
4.div-image{
5  background-image: url("Image Path");
6  background-position: 
7    top right  | left center   | bottom center
8    top left   | right center  | bottom right
9    top center | center center | bottom left ;
10  /* Use any option that met your requirements*/
11  background-size: cover; /* Set the image to cover all the div */
12  background-repeat: no-repeat; /* Commonly used for that situation */
13  background-attachment: fixed; /* the image will stay with you while scrolling same as position: fixed*/
14  /* Use background-attachment: scroll [Default Value]; to remove fixed effect */
15}
16/* 
17  Background shortHand 
18  background: background-color background-image background-repeat background-position
19*/
similar questions
queries leading to this page
css background