x
 
1
<!DOCTYPE html>
2
<title>Example</title>
3
<style>
4
    .outer {
5
        border: solid;
6
        width: 280px; 
7
    }
8
    .inner {
9
        background: gold;
10
        width: 50%;
11
        margin: auto;
12
    }
13
</style>
14
15
<div class="outer">
16
    <div class="inner">This text has a margin of 'auto'. It is nested within a 'div' with a border to make it easier to see the effect of the margin.</div>
17
</div>