Being able to take the featured image of a page and use it as the background to a div has many uses, including creating responsive header banners with text. We simply need to get the URL of the featured image, choose a size (any of the default, or custom image sizes you’ve set in functions.php) and then echo that as the background. You’ll see in this example that I’ve set the background to cover, but you can do whatever you like with it. You might also want to create those other styles as a class in your main stylesheet, I’ve just added them inline for the purpose of this example.
<?php $background = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' ); ?>
<div style="background-image: url(<?php echo $background; ?>); background-size: cover; background-position: center center; height: 300px;">