Q:

How to display posts with Category named news

I just created a new page template and want to print all posts with category news only. 
Used this code based on wordpress codex when it works. 
<? php
    query_posts( 
        array ( 
            'post_type' => 'post', 
            'category_name' => 'news', 
            'category' => 1,
            'posts_per_page' => 3 ) 
        );      
        // The Loop

        while ( have_posts() ) : the_post();
            the_title();
            the_content();           
        endwhile;   
        // Reset Query
        wp_reset_query();
? >

How can wrap the title into an h1 tag and the content into a div box? 
I tried this but it is giving me syntax error:
<h1><?php the_title(); ? ></h1>

Hope you can help. 

A:

 <? php global $post;
    $args = array( 
        'posts_per_page' => 3,
        'post_type' => 'post',
      'category' => 1
    );
    $myposts = get_posts( $args );
    foreach ( $myposts as $post ) : setup_postdata( $post ); 
the_title( '<h1 class="entry-title">', '</h1>' );
endforeach; 
        wp_reset_postdata();
    ? >

