I am working on a game site and I want to place two divs inside the div 'header' so that they are horizontally aligned, and a div to the left and right of this container. The following is an example:
Oli Matt
Here is my attempt. What is my mistake?
HTML:
<div class="header">
<div class="playerOne">
Oli
</div>
<div class="playerTwo">
Matt
</div>
</div>
CSS
.header{
display: inline-block;
}
.playerOne{
margin-left: 0;
}
.playerTwo{
margin-right: 0;
}
source
share