PHP/CSS: Shortcode won’t display correctly, and only displays in the head (before content)

As we can see on the Codex, all strings produced in a Shortcode must be returned instead of echoing them.