+ 2

What is the problem?

The div isn't shifting left! https://code.sololearn.com/WEp7UFvcHwVd/?ref=app

23rd Jun 2017, 6:23 AM
Prabhakar Dev
Prabhakar Dev - avatar
3 odpowiedzi
+ 24
use margin-left:50; instead of left:50;
23rd Jun 2017, 6:27 AM
Mansi Dagla
Mansi Dagla - avatar
+ 4
'margin-left' and 'left' don't have the same purpose... "left" property only works will 'positionned' elements, through the definition of the display property; adding "display:relative;" or "display:absolute;' to your element styles will let the 'left' property correctly work (but not always as expected, as behaviour of positionned elements is quite not obvious and is relative (even if using 'absolutte' value ^^) to different things dependinfg of context ^^ (commonly, 'relative' is relative to element "normal' position, while 'absolute" is relative to first positionned parent, if not to the <body> root visual element ;)
23rd Jun 2017, 6:52 AM
visph
visph - avatar
+ 2
ok thanks
23rd Jun 2017, 6:27 AM
Prabhakar Dev
Prabhakar Dev - avatar