I Need help guys | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I Need help guys

My code has 3 section. The last two sections has the same background color . But my challenge is dat i want to remove the gap thats inbetween these div sections. I have tried alot by setting margin to 0 but di(nt work. https://code.sololearn.com/Wfh3Qr02kfJc/?ref=app

5th Jun 2023, 12:15 PM
Olayeye Eniola Olamilekan
Olayeye Eniola Olamilekan - avatar
7 Answers
+ 2
The default value for div is display: block Try display: inline-block to remove the gap. div{   display:inline-block;   padding:0px;   margin:0px; } Then you can change the margin for each div as you wish. https://code.sololearn.com/WdqGFSxW70N7/?ref=app
6th Jun 2023, 1:52 AM
Chris Coder
Chris Coder - avatar
+ 3
Share your code
5th Jun 2023, 12:16 PM
D Shah 🎯⏳️
D Shah 🎯⏳️ - avatar
+ 2
Well, you can force it with negative margins, but you'd probably be better served adding a container around them both for applying the background color.
5th Jun 2023, 12:30 PM
Orin Cook
Orin Cook - avatar
+ 2
Another div is probably fine since it's a non-semantic use case.
5th Jun 2023, 12:39 PM
Orin Cook
Orin Cook - avatar
0
Pls check
5th Jun 2023, 12:19 PM
Olayeye Eniola Olamilekan
Olayeye Eniola Olamilekan - avatar
0
How can i add cointainer to it
5th Jun 2023, 12:32 PM
Olayeye Eniola Olamilekan
Olayeye Eniola Olamilekan - avatar
0
Thanks everyone
6th Jun 2023, 8:27 PM
Olayeye Eniola Olamilekan
Olayeye Eniola Olamilekan - avatar