+ 3
How to set background-image in ces
This is code body{ background-image: url("/images/pattern-background-desktop.svg"); background-size: 100%; background-repeat: no-repeat; background-color: #E0E8FF;; display: block; display: flex; justify-content: center; align-items: center; min-height: 100vh; }
18 Respostas
+ 2
Ayato Sakamaki
Share your code here..
+ 1
The code is correct, may be the image can't be found
+ 1
Ayato Sakamaki
Can you explain what is`ces`?
If you're having trouble in code, share your code link.and then describe what error message you're receiving.
+ 1
Ayato Sakamaki
Are you talking about overflow?
If yes,you can try this..
//change image according to you
body {
margin:0;
display:flex;
flex-direction:column;
justify-content:center;
align-items:center;
background-size:cover;
background-color:;
background-image:url("https://i.ibb.co/7J534Cn/IMG-20211207-232347.jpg");
background-size:100vw 100vh;
position:fixed ;
}
+ 1
Mihaly Nyilas no bro idk how to explain but image should be in center when I shorten window this image's 50% of bottom part pulls down
0
Aweneg Rooney no when I run code and decreasing window size it's pulls down image
0
Darpan kesharwani🇮🇳 I mean css
0
Ayato Sakamaki
The error in the provided code is the extra semicolon after the `background-color` property.
Remove the extra semicolon after `background-color: #E0E8FF` and the code should work fine.
And Make sure to replace `"/images/pattern-background-desktop.svg"` with the actual path to your image file.
Again:-
Dont send incomplete code,If you're having trouble in code, share your code and describe what error message you're receiving. without watching no one can figure out what's going wrong.
0
Darpan kesharwani🇮🇳 I did that but like on browser when I try to change size make half or somthing like that it's pulls down image
0
Darpan kesharwani🇮🇳 basic html and this code that I provided in css nothing more
0
hi
0
It’s not Ces it’s CSS
0
Darpan kesharwani🇮🇳 idk what it is I will keep how it looks I think my browser has problem
0
.... and make sure you name it `*.css` and include it into your html page (in the <head> tag with <link>) and the background image location is correct, the file exists....
the other option, use <style> tags inside the <head> tags.
I think these are enough for now
0
The code uses a relative link, consider using an absolute link to the full url of the image.
0
Ayato Sakamaki ,
Try using margin:0 auto instead?
Also, there is a @media tag for CSS. You can style your web in different device width or window. I hope this helps.
0
Did it get sorted buddy