Plenty of people who represent themselves as "front-end" "developers" know a good amount of Javascript, or at least some frameworks, but barely know HTML and CSS. This question (and some of the others) filtered out those people.
It filtered out people who didn't know how to use HTML and CSS to render a modal, which is a very specific and not-widely-used HTML/CSS technique.
It filtered out people without a good general knowledge of HTML and CSS and the creativity and problem-solving skills to apply that knowledge.
There's nothing problem-solving about it - they either know some obscure CSS tag or they don't. You're not really testing any skills at all with the question.