[SOLVED] CSS problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

[SOLVED] CSS problem

Tell me why the background origin property is not working for div with id style. In my view every thing seems to be all right but it is not responding according to my expectation. I wanna make a code where the background origin property changes as I click them. https://code.sololearn.com/WtvPCbWzNvvT/?ref=app

1st Aug 2020, 1:46 AM
Ayush Kumar
Ayush Kumar - avatar
4 Answers
+ 6
Add border: 20px solid white; padding: 20px; to #style https://code.sololearn.com/WhQ916u8O4pS/?ref=app
1st Aug 2020, 2:01 AM
Gordon
Gordon - avatar
+ 1
It is working test it by adding padding #style element and then change to content-box origin You will see background-image gets shifted to the content area
1st Aug 2020, 2:01 AM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
+ 1
Ops 🤦‍♂️🤦‍♂️🤦‍♂️ without padding and border how will it work Gordon.. Acctuly I did a silly mistake Thanks @Gordon and Мг. Кнап🌠
1st Aug 2020, 2:18 AM
Ayush Kumar
Ayush Kumar - avatar
+ 1
Right ODLNT
1st Aug 2020, 2:43 AM
Ayush Kumar
Ayush Kumar - avatar