The 7th lesson of CSS Positioning, topic name Margin is not working


#1

https://www.codecademy.com/courses/web-beginner-en-6merh/1/2?curriculum_id=50579fb998b470000202dc8b

Whenever i click on save and submit code it throws an error stating that "Oops, try again. Did you remember to set the div's margin to auto". The code works fine but doesn't lemme proceed . Below is the code, please lemme know if i am making a mistake.

* {
	border: 1px dashed black;
}

div {
	height: 50px;
	width: 100px;
	border: 2px solid black;
	border-radius: 5px;
	background-color: #308014;
	margin : auto;
}


#2

Put margin: auto. You don't have to put space before the : .


#3

@fndiaye2016
that worked thank you.
But i never got an issue for this space i always used to put for a clean look. it always used to skip that.

Thanks again :slight_smile:


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.