I want to create the following layout:
+----------------------------------+
| TITLE |
| |
| + |
| |
| (drop here) |
+----------------------------------+
using the following HTML:
<div class="drop-box">
<p>TITLE</p>
<p>(drop here)</p>
</div>
and CSS:
.drop-box {
width: 300px;
height: 150px;
border: 1px solid black;
text-align: center;
}
.drop-box:before {
content: "+";
width: 100%;
height: 100%;
font-size: 3em;
text-align: center;
line-height: 150px;
display: block;
}
The problem is that the text is now placed under the box with a "+" inside. How can I get the text to be placed inside the box. I tried to use position: relativefor tags p, but this does not work.
I created a pen for this here: http://codepen.io/kdbruin/pen/ryMjgb
source
share