Examples of Design Web Pages in HTML
Let’s create some web pages to see the resultant web page.
Example #1: Travel Webpage
Here, we will create an amazing travel webpage showcasing places to visit in Switzerland. We will set one background image and add some text using HTML Code and Styling.
HTML Code:
<style>
.card {
max-width: 380px;
margin: auto;
text-align: center;
}
#main {
background-image: url('switzerland.jpg');
background-repeat: no-repeat;
background-size: cover;
}
.price {
color: #f1294a;
font-size: 18px;
}
.card button {
padding: 10px;
color: white;
background-color: #f1294a;
text-align: center;
}
</style>
<h2 id="Places-to-Visit-in-Switzerland">Places to Visit in Switzerland</h2>
<div class="card">
<h1 id="b-Explore-Switzerland-b"><b>Explore Switzerland</b></h1>
<h3 id="Starting-from-CHF">Starting from CHF 2000</h3>
<h2>
<ul>
<li>Zurich</li>
<li>Geneva</li>
<li>Lucerne</li>
<li>Interlaken</li>
<li>Zermatt</li>
</ul>
</h2>
<p><button>Book Here</button></p>
</div>
Output:

We will build one Feedback form in the form of a web page in this example.
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: Arial, sans-serif;
}
input[type=text], select, textarea {
width: 100%;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
margin-top: 4px;
margin-bottom: 10px;
}
input[type=submit] {
background-color: #4CAF50;
color: white;
padding: 8px 12px;
border: none;
border-radius: 4px;
cursor: pointer;
}
.container {
width: 80%;
max-width: 500px;
margin: 0 auto;
border-radius: 6px;
background-color: #F2F2F2;
padding: 20px;
}
h3 {
text-align: center;
}
label {
font-weight: bold;
}
textarea {
resize: vertical;
}
/* Optional: Add additional styles to make it more visually appealing */
.container {
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
input[type=submit]:hover {
background-color: #45a049;
}
</style>
<h3 id="We-Value-Your-Suggestions">We Value Your Suggestions!</h3>
<div class="container">
<form>
<label for="fname">First Name</label>
<input type="text" id="fname" name="firstname" placeholder="Enter your name">
<label for="lname">Last Name</label>
<input type="text" id="lname" name="lastname" placeholder="Enter your last name">
<label for="email">Email</label>
<input type="text" id="email" name="email" placeholder="Enter your email here">
<label for="subject">Suggestion</label>
<textarea id="subject" name="subject" placeholder="Provide your suggestion" style="height: 100px"></textarea>
<input type="submit" value="Submit">
</form>
</div>
Output:

Example #3: OTT Platform Homepage
In this example, we will create another web page that showcases an amazing homepage for an OTT platform.
HTML Code:
<title>My OTT Platform</title>
<style>
/* CSS styles for the website */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #000;
color: #fff;
}
header {
background-color: #e50914;
padding: 20px;
text-align: center;
}
header h1 {
margin: 0;
font-size: 28px;
text-transform: uppercase;
color: #fff;
}
nav {
background-color: #000;
padding: 10px;
text-align: center;
}
nav a {
text-decoration: none;
margin: 10px;
color: #fff;
font-weight: bold;
}
main {
padding: 20px;
}
footer {
background-color: #e50914;
padding: 20px;
text-align: center;
}
.video {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin-bottom: 20px;
}
.video .thumbnail {
position: relative;
width: 250px;
height: 140px;
margin: 10px;
overflow: hidden;
transition: transform 0.3s;
background-color: #333;
}
.video .thumbnail img {
width: 100%;
height: 100%;
object-fit: cover;
}
.video .thumbnail:hover {
transform: scale(1.1);
}
.video .title {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
background-color: rgba(0, 0, 0, 0.7);
color: #fff;
padding: 10px;
margin: 0;
font-weight: bold;
}
/* Additional styles for Netflix-like appearance */
header, nav, main, footer {
max-width: 1200px;
margin: 0 auto;
}
.video .thumbnail {
width: 275px;
height: 155px;
}
.video .title {
font-size: 14px;
padding: 8px;
}
</style>
<header>
<h1 id="Welcome-to-My-OTT-Platform">Welcome to My OTT Platform</h1>
</header>
<nav>
<a href="#">Home</a>
<a href="#">Movies</a>
<a href="#">TV Shows</a>
<a href="#">Documentaries</a>
<a href="#">My Account</a>
</nav>
<main>
<h2 id="Trending-Now">Trending Now</h2>
<div class="video">
<div class="thumbnail">
<img src="/static/imghwm/default1.png" data-src="video5.jpg" class="lazy" alt="Video 5">
<div class="title">Movie1</div>
</div>
<div class="thumbnail">
<img src="/static/imghwm/default1.png" data-src="video6.jpg" class="lazy" alt="Video 6">
<div class="title">Movie2</div>
</div>
<div class="thumbnail">
<img src="/static/imghwm/default1.png" data-src="video7.jpg" class="lazy" alt="Video 7">
<div class="title">Movie3</div>
</div>
</div>
<h2 id="Top-Shows">Top 3 Shows</h2>
<div class="video">
<div class="thumbnail">
<img src="/static/imghwm/default1.png" data-src="video8.jpg" class="lazy" alt="Video 8">
<div class="title">Show1</div>
</div>
<div class="thumbnail">
<img src="/static/imghwm/default1.png" data-src="video9.jpg" class="lazy" alt="Video 9">
<div class="title">Show2</div>
</div>
<div class="thumbnail">
<img src="/static/imghwm/default1.png" data-src="video10.jpg" class="lazy" alt="Video 10">
<div class="title">Show3</div>
</div>
</div>
<h2 id="International-Movies">International Movies</h2>
<div class="video">
<div class="thumbnail">
<img src="/static/imghwm/default1.png" data-src="video11.jpg" class="lazy" alt="Video 11">
<div class="title">Movie1</div>
</div>
<div class="thumbnail">
<img src="/static/imghwm/default1.png" data-src="video12.jpg" class="lazy" alt="Video 12">
<div class="title">Movie2</div>
</div>
<div class="thumbnail">
<img src="/static/imghwm/default1.png" data-src="video13.jpg" class="lazy" alt="Video 13">
<div class="title">Movie3</div>
</div>
</div>
</main>
<footer>
<p>© 2023 My OTT Platform. All rights reserved.</p>
</footer>
Output:

Example #4 Newsletter Subscription Page
In this example, let’s create a simple subscription page where users can subscribe to a newsletter.
Output:

Example #5: Guess the Number Game
In this instance, we will design a simple game where users have to guess the number generated by the system.
<title>Guessing Game</title>
<style>
body {
text-align: center;
padding-top: 100px;
font-family: Arial, sans-serif;
background-color: #f2f2f2;
}
h1 {
color: #333333;
}
p {
color: #666666;
}
input {
padding: 10px;
font-size: 16px;
border-radius: 4px;
border: 1px solid #cccccc;
}
button {
padding: 10px 20px;
font-size: 16px;
background-color: #4CAF50;
color: white;
border-radius: 4px;
border: none;
cursor: pointer;
}
button:hover {
background-color: #45a049;
}
#result {
margin-top: 20px;
font-weight: bold;
}
</style>
<h1 id="Guessing-Game">Guessing Game</h1>
<p>Guess a number between 1 and 10:</p>
<input type="number" id="guess" min="1" max="10">
<button onclick="checkGuess()">Submit</button>
<p id="result"></p>
<script>
function checkGuess() {
var guess = parseInt(document.getElementById("guess").value);
var randomNumber = Math.floor(Math.random() * 10) + 1;
if (guess === randomNumber) {
document.getElementById("result").innerHTML = "Congratulations! You guessed the correct number.";
} else {
document.getElementById("result").innerHTML = "Wrong guess. The correct number was " + randomNumber + ".";
}
}
</script>
Output:

Conclusion
From all the above discussion, we can say that Web pages are created by using HTML code in a very simplified manner. Just simply put your HTML code in any one editor, save it with the .html extension, and open it within any browser.