Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren0
Why does margin has not any effect on right side of div tag???
Review this code and suggest me how to fix it..... https://code.sololearn.com/W3YO3vl8t5PM/?ref=app
3 Antworten
+ 2
If you set margin:10px;
It will applied from all side .
But if it is not available horizontally priority will given to the left.
And also width is not 100%
It is actually 100%+20px(due to padding of 10px in each side.)
Some useful tips
Read about box-sizing: border-box; property
And indivisual margin setting +. Margin shorthand
margin: 10px 9px 8px 7px ;
Margin-left: 5px;
.....
.....
.......
+ 2
First try to set margin and padding equals zero of body tag in your project.
+ 1
Try remove width:100%;