When working with Drupal, it may be a bit tricky to perform a PHP check to determine if a page is a 404 error page or if the body tag of the 404 page has a specific CSS class. If there is a CSS class on the body tag that relates to an error page, you can target elements accordingly (e.g., target the breadcrumb by using 'body.error .breadcrumbs {display: none;}'). If this approach is not feasible, you can refer to
The guide provides instructions on creating your custom 404 page.
Create two nodes for different types of page errors (403 and 404).
Find the ID number of the node you want users to be redirected to. You can locate the node's ID number by checking the number after the last slash in the browser's address bar when visiting the node.
Input the paths to your nodes in the relevant fields on your error reporting settings page. For example, if the node ID number for 403 error codes is "83," input "node/83" in the "Default 403 (access denied) page" setting.
In Drupal 6, go to mysite.com/admin/settings/error-reporting
In Drupal 7, visit mysite.com/admin/config/system/site-information
The nodes you create will appear in various blocks like tracker and popular content, just like regular nodes. If this is undesired, consider using a contributed module like Custom Error to address this issue.
You might also want to explore the Redirect 403 to User Login module for Drupal 7, which allows redirection to the login page and customization of 403 and 404 error messages.
EDIT
To make changes, navigate to sites/all/themes/themename/template.php and modify the file.
Add the following code snippet at the beginning:
function themename_preprocess_page(&$vars) {
// Adds a Custom 404 page
$header = drupal_get_http_header("status");
if($header == "404 Not Found") { ?>
<style>
.your-custom-css-here {}
</style>
<?php }
}