CSS only Phone Frame
CSS only Phone Frame
by dhavaljani
HTML
<div class="phone-wrap">
<div class="phone-frame">
<iframe src="https://wikimedia.org" style="border: none; position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; z-index: auto; opacity: 1;"></iframe>
</div>
</div>
CSS
.phone-wrap {
height: 700px;
width: 350px;
position: relative;
max-width: 100%;
margin-left: auto;
margin-right: auto;
}
.phone-frame {
position: absolute;
width: 90%;
top: 5%;
bottom: 5%;
left: 5%;
right: 5%;
background: -webkit-linear-gradient(to left, #bbb 0%, #FFF 5%, #eee 95%, #bbb 100%);
background: -o-linear-gradient(to left, #bbb 0%, #FFF 5%, #eee 95%, #bbb 100%);
background: -moz-linear-gradient(to left, #bbb 0%, #FFF 5%, #eee 95%, #bbb 100%);
background: linear-gradient(to left, #bbb 0%, #FFF 5%, #eee 95%, #bbb 100%);
text-align: center;
border-radius: 30px;
border: 2px solid #bbb;
box-shadow: 0 0 8px rgba(25, 25, 25, 0.5);
}
.phone-frame:before {
width: 16%;
height: 10px;
border-radius: 5px;
background: #ddd;
content: '';
position: absolute;
top: 15px;
left: 42%;
border: 1px solid #ccc;
box-shadow: inset 0 0 3px #bbb;
}
.phone-frame:after {
width: 40px;
height: 40px;
border-radius: 50%;
background: #ddd;
border: 1px solid #ccc;
content: '';
position: absolute;
bottom: 10px;
left: 45%;
box-shadow: inset 0 0 3px #bbb;
}
.phone-frame iframe {
margin-top: 12%;
border: 1px solid #ccc !important;
height: 84% !important;
width: 92% !important;
left: 4% !important;
}
::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
background-color: #F5F5F5;
}
::-webkit-scrollbar
{
width: 12px;
background-color: #F5F5F5;
}
::-webkit-scrollbar-thumb
{
border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);
background-color: #23C9C7;
}