too long

I have a container created in style.css file. And, how can i display a container if user is logged in and don't if he's not logged in ?

CODE:

<div class="container">

<?php
if($_SESSION['id'])
echo '<center>TURINYS MATOMAS TIK NARIAMS</center>';
?>
</div>

Now here, if user is logged in, it displays text "TURINYS MATOMAS TIK NARIAMS", but if user is not logged in it just displays a blank container

I didn't test the code, but this should work:

<?php if($_SESSION['id']) : ?>

  <div class="container">
    <center><?php echo 'TURINYS MATOMAS TIK NARIAMS'; ?> </center>
  </div>

<?php endif; ?>
<?php if(isset($_SESSION['id'])){ ?>
  <div class="container">
    <center>
        <?php echo 'TURINYS MATOMAS TIK NARIAMS'; ?> 
    </center>
  </div>
<?php } ?>