Reputation: 341
I need to create something where the outline of a phone covers a textarea
.
This is the img source and my current code is:
CSS:
div.sms{
position: absolute;
top:0;
left:0
z-index:99;
}
div.sms img{
width: 300px;
height: 510px;
}
div.sms textarea{
position: absolute;
}
HTML:
<div class="row">
<div class="col-md-6 sms">
<img src="https://i.sstatic.net/n5Ksf.png"/>
<textarea rows="4"></textarea>
</div>
</div>
Upvotes: 1
Views: 1445
Reputation: 103780
You could place the image as background of a wrapper div
and simply position the textarea
inside that wrapper with margins :
.wrap{
background: url('http://i.imgur.com/S66oEHW.png') no-repeat;
background-size: contain;
height:500px;
min-width:300px;
}
.wrap textarea{
margin:75px 0 0 53px;
width:183px;
height:350px;
}
<div class="wrap">
<textarea></textarea>
</div>
Upvotes: 2