How to make a content center in the page

To make center display of any content, you should have these properties for the content:

1. display: block;

2. width:500px;

3. margin: 0 auto;

<body>

<div class="content">

</div>

</body>

The css should be:

.content{

margin:0 auto;

display:block;

width: 50%;}

The output would be like that

This is content