use css classes instead of setting inline styles for pointer events