I tried all things I don't know how to put a background image without the image repeats ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

I tried all things I don't know how to put a background image without the image repeats ?

22nd Jul 2021, 2:42 PM
Nv Abdallah
Nv Abdallah - avatar
15 Answers
+ 4
Try: background-repeat: no-repeat; You may also want to try if need to stretch to fill: background-size: cover;
22nd Jul 2021, 2:58 PM
Jakko Jak
Jakko Jak - avatar
+ 3
You don't need pro, otherwise you would see each one of us having pro . Email at "info@sololearn.com" or use search bar to search for similar questions like yours .
22nd Jul 2021, 4:24 PM
Abhay
Abhay - avatar
+ 1
Thank u
22nd Jul 2021, 3:45 PM
Nv Abdallah
Nv Abdallah - avatar
+ 1
Apply css background-repeat:no repeat; background-size:cover; Try to put link of code, it makes easy to slove your problem.
22nd Jul 2021, 6:23 PM
Kavya N
Kavya N - avatar
0
Can I please give the hole code
22nd Jul 2021, 3:03 PM
Nv Abdallah
Nv Abdallah - avatar
0
Nv Abdallah Make your code public or share it here to get better and quick response
22nd Jul 2021, 3:07 PM
Divya Mohan
Divya Mohan - avatar
0
Now it's public
22nd Jul 2021, 3:15 PM
Nv Abdallah
Nv Abdallah - avatar
0
You have written background-image:cover; Actually it will background-size:cover; also height :100vh; 100% will not work here
22nd Jul 2021, 3:18 PM
Divya Mohan
Divya Mohan - avatar
0
I changed it and it still the problem
22nd Jul 2021, 3:21 PM
Nv Abdallah
Nv Abdallah - avatar
0
height:100vh; for body
22nd Jul 2021, 3:22 PM
Divya Mohan
Divya Mohan - avatar
0
padding:10px; margin:0; background-image:url("https://i.pinimg.com/474x/ac/be/ac/acbeac1102af1cb78881601f42201b87.jpg "); background-size: cover; width:100% ; height:100vh;
22nd Jul 2021, 3:25 PM
Divya Mohan
Divya Mohan - avatar
0
What about vh what does it mean
22nd Jul 2021, 3:31 PM
Nv Abdallah
Nv Abdallah - avatar
0
% work if the parent has fixed length unit like px, vh,vw, em..etc. Vh mean viewport height the height of window excluding urlbar..
22nd Jul 2021, 3:44 PM
Divya Mohan
Divya Mohan - avatar
0
Btw if I wanna activitie my account here is it obligatory to get the pro version
22nd Jul 2021, 3:47 PM
Nv Abdallah
Nv Abdallah - avatar
0
Background-repeat:no-repeat;
24th Jul 2021, 7:51 AM
Parth Goti
Parth Goti - avatar