Use CSS to show and hide elements correctly