I was teaching my sister how to do CSS and encounter this weird issue - ID behaves like a class. In my HTML, there are two elements sharing the same id. I was expecting that the first element containing that id will be the one who gets styled, the second element containing that id should not be styled right?
<!DOCTYPE html>
<html>
<head>
<title>ID test</title>
<style>
#id1{
color: blue;
}
</style>
</head>
<body>
<div id="id1">text1</div>
<div id="id1">text2</div>
</body>
</html>
But this is the result. Both of them gets styled with the text color blue: