Web_Tutorial_Answers
Web_Tutorial_Answers
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: #ffe6f0;
text-align: center;
font-family: Arial;
}
.invitation {
background: #fff;
padding: 20px;
margin: 50px auto;
width: 60%;
border: 2px solid #ff66b2;
}
</style>
</head>
<body>
<div class="invitation">
<h1>You're Invited!</h1>
<p>Join us to celebrate Sarah's 10th Birthday!</p>
<p>Date: June 1, 2025<br>Time: 3:00 PM<br>Location: 123 Party Lane</p>
<p>RSVP: 123-456-7890</p>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: sans-serif;
margin: 20px;
}
img {
width: 150px;
border-radius: 50%;
}
table, th, td {
border: 1px solid black;
border-collapse: collapse;
padding: 5px;
}
</style>
</head>
<body>
<h1>John Doe</h1>
<img src="photo.jpg" alt="Profile Photo">
<h2>Hobbies</h2>
<ul>
<li>Coding</li>
<li>Photography</li>
<li>Reading</li>
</ul>
<h2>Education</h2>
<table>
<tr><th>Year</th><th>Degree</th><th>Institution</th></tr>
<tr><td>2020</td><td>BSc Computer Science</td><td>XYZ University</td></tr>
<tr><td>2023</td><td>MSc IT</td><td>ABC Institute</td></tr>
</table>
</body>
</html>
4) Types of CSS
- Inline CSS
<p style="color: blue;">This is inline CSS.</p>
- Internal CSS
<head>
<style>
p { color: green; }
</style>
</head>
- External CSS
<link rel="stylesheet" href="style.css">
In style.css:
p {
color: red;
}
<!DOCTYPE html>
<html>
<head>
<style>
#header {
background-color: navy;
color: white;
padding: 10px;
}
.section {
border: 1px solid gray;
margin: 10px;
padding: 10px;
}
</style>
</head>
<body>
<div id="header"><h1>My Website</h1></div>
<div class="section"><p>This is section 1</p></div>
<div class="section"><p>This is section 2</p></div>
</body>
</html>
Request:
GET /index.html HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0
Accept: text/html
Response:
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 1024
<html>...</html>
Request Headers:
- Host: Specifies the domain name.
- User-Agent: Info about client browser.
- Accept: Types of media client accepts.
- Authorization: Credentials for authentication.
Response Headers:
- Content-Type: Type of content returned.
- Content-Length: Size of response.
- Set-Cookie: Sets cookies on client.
- Cache-Control: Caching policies.
8) Web Browser Architecture
SEO (Search Engine Optimization) is the process of improving a website's visibility on search
engines like Google.
It increases traffic, credibility, and reach, making it essential for modern websites.
<!DOCTYPE html>
<html>
<head>
<style>
body {
margin: 0;
font-family: Arial;
}
.container {
display: flex;
flex-direction: row;
}
.box {
flex: 1;
padding: 20px;
background: lightblue;
}
@media (max-width: 600px) {
.container {
flex-direction: column;
}
}
</style>
</head>
<body>
<div class="container">
<div class="box">Box 1</div>
<div class="box">Box 2</div>
</div>
</body>
</html>