No ID, No Entry - Why aren't the 'archenemy' and 'best_friend' divs formatted as 'enemy' and 'friend' before adding ID css in the next section?


#1



No ID, No Entry - Why aren't the 'archenemy' and 'best_friend' divs formatted as 'enemy' and 'friend' before adding ID css in the next section? They just come through as standard black circles. Do they not inherit the class from the parent? Why is it letting me continue without an error if I need to add the class to them as well?


<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title>My Social Network</title>
	</head>
	<body>
		<!--Add your HTML below!-->
		<div class="friend">
		    <div id="best_friend">
		    </div>
		</div>
		<div class="family">
		</div>
		<div class="enemy">
		    <div id=archnemesis>
		    </div>
		</div>
	</body>
</html>


#2

The exercise suggest to add the id to an already existing div which already has a class

You seem to have it done differently. The exercise approves because you do have both an id and class, although, be it not on the same div

the ids won't inherit from there class parent, why would they?


#3

I don't know why they would, the fact that it let me continue made me think that they were supposed to but the display wasn't responding correctly.


#4

i would just add the id to a div element which already has a class

Well, the endless balance between freedom in the lesson and that sometimes something might slip through the cracks, and the no creativity, only an exact match to desired result, so nothing will slip through. Sometimes (rarely) an exercise allows not perfect code to slip through