BIT251 ยท 2080 ยท 10 marks
Define HTML head and body tags. Write HTML script to display following output. The title of the page should be 'BIT Web Tech'.
Define HTML head and body tags. Write HTML script to display following output. The title of the page should be 'BIT Web Tech'.[10]
HTML Head and Body Tags
Definition
<head> Tag
The <head> tag is a container element that holds meta-information about the HTML document. The content inside the <head> tag is not displayed directly on the web page. It contains elements such as:
<title>- defines the title of the page (shown in browser tab)<meta>- provides metadata like charset, author, description<link>- links external stylesheets<style>- contains internal CSS<script>- contains or links JavaScript
Syntax:
<head>
<!-- meta information goes here -->
</head>
<body> Tag
The <body> tag defines the main content of the HTML document that is visible to the user in the browser window. It contains all the displayable content such as:
- Headings, paragraphs, images, links, tables, lists, forms, etc.
Syntax:
<body>
<!-- visible content goes here -->
</body>
HTML Script
Note: Since no image of the required output was provided, the following is a commonly expected output for this type of question in TU BScCSIT/BIT exams, featuring a heading, a table, and a list. Adjust content if your question had a specific screenshot.
<!DOCTYPE html>
<html>
<head>
<title>BIT Web Tech</title>
</head>
<body bgcolor="lightblue">
<h1 align="center">Welcome to BIT Web Tech</h1>
<hr>
<h2>Course Information</h2>
<table border="1" cellpadding="5" cellspacing="0">
<tr bgcolor="yellow">
<th>S.N.</th>
<th>Course Name</th>
<th>Credit Hour</th>
</tr>
<tr>
<td>1</td>
<td>Web Technology</td>
<td>3</td>
</tr>
<tr>
<td>2</td>
<td>Database Management</td>
<td>3</td>
</tr>
<tr>
<td>3</td>
<td>Programming in C</td>
<td>3</td>
</tr>
</table>
<h2>Key Features</h2>
<ul>
<li>HTML and CSS</li>
<li>JavaScript</li>
<li>PHP and MySQL</li>
</ul>
<h2>Semester List</h2>
<ol>
<li>First Semester</li>
<li>Second Semester</li>
<li>Third Semester</li>
</ol>
<hr>
<p align="center">
<b>Contact us at:</b>
<a href="mailto:[email protected]">[email protected]</a>
</p>
</body>
</html>
Expected Browser Output
| Element | Description |
|---|---|
| Browser Tab | Shows BIT Web Tech |
| Page Heading | "Welcome to BIT Web Tech" centered |
| Table | Course information with border |
| Unordered List | Key features with bullet points |
| Ordered List | Semester list with numbers |
| Footer | Contact email as hyperlink |
Summary Table of Head vs Body
| Feature | <head> | <body> |
|---|---|---|
| Visibility | Not visible to user | Visible to user |
| Contains | Title, meta, style, script | Text, images, tables, forms |
| Purpose | Document information | Document content |
| Required | Yes | Yes |
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.