<?php
$css = "style=''";
if ( has_post_thumbnail( get_the_ID ) ) :
$size = 'large'; // choose size of image to be used
$thumb_id = get_post_thumbnail_id();
$thumb_object = wp_get_attachment_image_src($thumb_id, $size, true);
$thumb_url = $thumb_object[0];
$css = "background-image:url('$thumb_url'); background-size:cover; background-position:top-center no-repeat;"
endif;