In short, there was a controversy in the 1940s or 50s about violence and horror in comic books. This lead to the creation of the comics code. It was similar to a rating system that there wouldn'e be explicit violence or sexual themes in the issue. I think that's when superhero comics became "kid-friendly", but I could be wrong.