<div style="display: flex; flex-flow:row wrap;  gap:10px;">
  <?php
    // Get the post ID
    $post_id = get_the_ID();

    // Get the categories for this post
    $categories = get_the_category($post_id);

    // Output the categories
    foreach ($categories as $category) {
        // echo '<a href="' . esc_url(get_category_link($category->term_id)) . '">' . esc_html($category->name) . '</a>, ';
        echo '<div>'.esc_html($category->name).'</div>';
    }
  ?>
</div>