http://jsfiddle.net/vmedg/
To achieve the desired appearance shown in the image, there are various approaches you can take. I will provide an example to help you get started.
Personally, I find using position: absolute
to be more convenient when arranging multiple boxes within a single container. In some cases, achieving the layout without it can be quite challenging. By setting the element with the class .letter
to top: 0
and left: 0
, it will be positioned at the top left corner. However, if you want the letter to span across the entire container as depicted in your image, you can simply add bottom: 0
to make it stretch fully.
Here is the HTML structure:
<div class="container">
<div class="letter">A</div>
<div class="number one">1</div>
<div class="number two">2</div>
<div class="number three">3</div>
</div>
The CSS styling is as follows:
.container {
position: relative;
width: 300px;
height: 300px;
background: silver; // To replicate the white background in your image, remove this line
}
.letter {
position: absolute;
left: 0;
top: 0;
width: 80%;
bottom: 0;
display: inline-block;
border: 1px solid black;
font-size: 248px;
text-indent: 30px;
}
.number {
position: absolute;
right: 0;
width: 19%;
height: 33%;
border: 1px solid black;
font-size: 60px;
text-indent: 15px;
}
.one {
top: 0;
}
.two {
top: 33%;
}
.three {
top: 66%;
}