You can create two squares of different sizes, one inside the other.
See this script: http://jsfiddle.net/a_incarnati/5ouvn063/2/
CSS
div.inner {
width: 200px;
height: 200px;
padding: 20px;
background-color: red;
}
div.outer {
width: 240px;
height: 240px;
padding: 20px;
background-color: blue;
}
HTML
<div class="outer"><div class="inner"></div></div>
In fact, you can even remove the width and height of the outer div and place the element to the left.
EDIT
div.inner {
width: 200px;
height: 200px;
padding: 20px;
background-color: red;
}
div.outer {
padding: 20px;
background-color: blue;
float:left;
text-align:center;
}
DEMO # 2 http://jsfiddle.net/a_incarnati/5ouvn063/3/
source
share