Hey friends, today I will show how to make a virtual website inside a smartphone view like the photo above. Do check out my video tutorial below:
What is this project? Using this project, you can present a display/prototype of how a website looks like in smartphone view. This is a fully functional project where you can even navigate the website inside and experience it.
For this project, paste the code below in your HTML file:
<!-- Created by CodingPorium,2021. Visit https://youtube.com/c/CodingPorium for more tutorials with free source code -->
<!DOCTYPE html>
<html>
<head>
<title>How to make Virtual Website in Smartphone Look | CodingPorium</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body{
background-color: dodgerblue;
}
/* The device with borders */
.smartphone {
position: relative;
width: 360px;
height: 640px;
margin: auto;
border: 16px black solid;
border-top-width: 60px;
border-bottom-width: 60px;
border-radius: 36px;
box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
}
/* The horizontal line on the top of the device */
.smartphone:before {
content: '';
display: block;
width: 60px;
height: 5px;
position: absolute;
top: -30px;
left: 50%;
transform: translate(-50%, -50%);
background: #333;
border-radius: 10px;
}
/* The circle on the bottom of the device */
.smartphone:after {
content: '';
display: block;
width: 35px;
height: 35px;
position: absolute;
left: 50%;
bottom: -65px;
transform: translate(-50%, -50%);
background: #333;
border-radius: 50%;
}
/* The screen (or content) of the device */
.smartphone .content {
width: 360px;
height: 640px;
background: white;
}
</style>
</head>
<body>
<div class="smartphone">
<div class="content">
<iframe src="https://codingporium.blogspot.com/2021/08/responsive-skills-bar-using-html-css.html" style="width:100%;border:none;height:100%" />
</div>
</div>
</body>
</html>
And that's all. Thanks for reading and I hope this project was useful.
Do subscribe to our Youtube channel to support us. Till the next one, goodbye!
Post a Comment