Reputation: 19252
I'm trying to center all 3 divs. Is there a way to get this done without creating a wrap around div2 and div3.
div1 | div2 | div3
------------------------------------------------
Upvotes: 0
Views: 52
Reputation: 21234
You could try something like this, as body will most probably be present:
<body>
<div class="centered" id="a">A</div>
<div class="centered" id="b">B</div>
<div class="centered" id="c">C</div>
</body>
CSS:
body {
text-align: center;
}
.centered {
display: inline-block;
}
Upvotes: 2