Hello,
I have two div's:
<div class="containe r">
<div class="message" >message</div>
</div>
I need to center the div "message" inside the div "container" .
But I also want the div "message" to have a constant margin of 20px
around it.
How can I do this?
I tried the following CSS but it is not working:
..container
{
border: solid 1px red;
text-align: center;
}
..message
{
border: solid 1px blue;
clear: both;
margin: 20px auto;
text-align: left;
width: 100%;
}
Thanks,
Miguel
I have two div's:
<div class="containe r">
<div class="message" >message</div>
</div>
I need to center the div "message" inside the div "container" .
But I also want the div "message" to have a constant margin of 20px
around it.
How can I do this?
I tried the following CSS but it is not working:
..container
{
border: solid 1px red;
text-align: center;
}
..message
{
border: solid 1px blue;
clear: both;
margin: 20px auto;
text-align: left;
width: 100%;
}
Thanks,
Miguel
Comment