How to detect 404 url and make this link underline or change background color?

<a id="block_bell" href="<?php echo get_home_url(); ?>/email-newsletter"><i class="fa fa-bell" aria-hidden="true"></i> &nbsp; Get New Posts Notification</a> 

if this page is not exist or redirect to 404 page, then make this text Get New Posts Notification background red.