8. Margin top, right, bottom, left


#1

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

Error message: "Oops, try again. It looks like your top margin isn't 20px."
What am I doing wrong?


* {
	border: 1px dashed black;
}

div {
	height: 50px;
	width: 100px;
	border: 2px solid black;
	border-radius: 5px;
	background-color: #308014
	
	margin-top: 20px;
    margin-right: 50px;
    margin-bottom: 10px;
    margin-left: 5px;
}


#2

@chipsurfer75967
1. end all definitions with a semi-colon ;
2. be sure the zoom is set to 100%


#3

I've done both now, the code still does not seem to want to co-operate. I've tried it in two different browsers now. I don't suspect its a bug, but I'm still rather confused.


#4

can we see an updated version of your code? In the code you posted in the topic, you do miss a ;, leonhard was hinting at this


#5

* {
	border: 1px dashed black;
}

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

#6

can we see your html code?


#7

<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title>Result</title>
	</head>
	<body>
		<div></div>
	</body>
</html>

#8

your code is fine now, what is the error message you are receiving?


#9

"Oops, try again. It looks like your top margin isn't 20px."
I've tried it in firefox and chrome, I'll see if the code will work in Edge


#10

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