HTML Element Style How to - Center a div inside of another div


We would like to know how to center a div inside of another div.


<!DOCTYPE html>
<style type='text/css'>
#container {<!--   w  w  w . j  ava2 s.c  o m-->
  width: 775px;
  margin: 0 auto;
  text-align: center;
  background: red;

.innerdiv {
  display: inline-block;
  text-align: left;
  background: green;
  <div id="container">
    <div class="innerdiv">Lorem Ipsum is simply dummy text of the
      printing and typesetting industry. Lorem Ipsum.

The code above is rendered as follows: