improve css for layout switching