KEMBAR78
Exam Questions - Web Design and Development | PDF | World Wide Web | Internet & Web
0% found this document useful (0 votes)
49 views6 pages

Exam Questions - Web Design and Development

Uploaded by

brianmkareithi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views6 pages

Exam Questions - Web Design and Development

Uploaded by

brianmkareithi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

WEB DESIGN AND DEVELOPMENT – FINAL

EXAM QUESTIONS WITH ANSWERS

SECTION A: MULTIPLE CHOICE QUESTIONS (MCQs) – 1


Mark Each
1. Which language is primarily used for web page structure?

2. a) CSS

3. b) HTML

4. c) JavaScript

5. d) PHP

6. Which of the following is NOT a programming language used in web


development?

a) Python

b) PHP

c) Bootstrap

d) JavaScript

7. What does CSS stand for?

a) Computer Styling Sheets

b) Cascading Style System

c) Cascading Style Sheets

d) Creative Style Sheets


8. Which HTML tag is used to create a hyperlink?

a) <link>

b) <url>

c) <a>

d) <hyper>

9. Which of the following properties is used to change text color in CSS?

a) text-color

b) color

c) font-color

d) text-style

10. What is the purpose of the <meta charset="UTF-8"> tag in HTML?

a) To set the page background color

b) To specify character encoding for the webpage

c) To include a JavaScript file

d) To define a title for the webpage

11. Which of the following is a valid way to define a JavaScript function?

a) function myFunction() {}

b) def myFunction() {}

c) func myFunction() {}

d) method myFunction() {}

12. Which of the following is NOT a valid HTML5 semantic element?

a) <section>
b) <article>

c) <div>

d) <header>

13. Which CSS property makes an element disappear from the page but keeps its
space reserved?

a) display: none;

b) visibility: hidden;

c) opacity: 0;

d) position: absolute;

14. Which JavaScript method is used to change the content of an HTML element?

a) document.changeText()

b) element.innerHTML = "New Text";

c) getElementById().modify()

d) updateText();

SECTION B: SHORT ANSWER QUESTIONS – 3 Marks Each


11. What are the differences between HTML and HTML5?
• HTML5 introduced new elements like <header>, <article>, <section>
• HTML5 supports video and audio without plugins (<video> and <audio>)
• HTML5 has improved form validation and attributes
12. Explain the role of JavaScript in web development.
• JavaScript makes web pages interactive.
• It allows dynamic content updates.
• It enables form validation and DOM manipulation.
13. Write an HTML code snippet that includes an external CSS file named
"styles.css".
<head>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>

14. Explain the difference between fixed, relative, and absolute positioning in CSS.
• Fixed: The element stays in one position even when scrolling.
• Relative: Positioned relative to its normal position.
• Absolute: Positioned relative to its nearest positioned ancestor.
15. What is the difference between GET and POST in HTTP?
• GET: Used to request data from a server (parameters are visible in the URL).
• POST: Used to send data to a server (parameters are hidden).

SECTION C: CODING QUESTIONS – 5 Marks Each


16. Write an HTML form with fields for name, email, and a submit button.
<form action="submit.php" method="post">
<label for="name">Name:</label>
<input type="text" id="name" name="name"><br>

<label for="email">Email:</label>
<input type="email" id="email" name="email"><br>

<input type="submit" value="Submit">


</form>

17. Write a JavaScript function that displays an alert message when a button is
clicked.
<button onclick="showAlert()">Click Me</button>
<script>
function showAlert() {
alert("Hello, Welcome to Web Design!");
}
</script>
18. Write a CSS rule to set the background color of a webpage to light gray and all
<h1> elements to blue.
body {
background-color: lightgray;
}

h1 {
color: blue;
}

19. Write a JavaScript function that validates whether a user has entered a valid
email address.
<form onsubmit="return validateEmail()">
<input type="email" id="email" required>
<input type="submit" value="Submit">
</form>

<script>
function validateEmail() {
let email = document.getElementById("email").value;
if (email.includes("@")) {
return true;
} else {
alert("Please enter a valid email address.");
return false;
}
}
</script>

SECTION D: LONG ANSWER QUESTIONS – 10 Marks Each


20. Explain the importance of responsive web design and provide an example of a
media query.
• Responsive Web Design ensures that websites adjust to different screen sizes.
• It improves user experience and accessibility.
• Example of a Media Query: @media (max-width: 768px) {
body {
background-color: lightgray;
}
}

21. Describe the process of hosting a website, including domain registration, web
hosting, and deployment.
• Domain Registration: Buy a domain (e.g., example.com).
• Web Hosting: Rent server space to store website files.
• Deployment: Upload files using FTP or platforms like GitHub Pages, Netlify, or
cPanel.
22. Discuss three website security threats and their countermeasures.
• SQL Injection: Use prepared statements.
• Cross-Site Scripting (XSS): Sanitize user input.
• Brute Force Attacks: Implement strong password policies and CAPTCHA.
23. Differentiate between client-side scripting and server-side scripting. Provide
examples.
• Client-Side Scripting: Runs on the user's browser (e.g., JavaScript).
• Server-Side Scripting: Runs on the server (e.g., PHP, Node.js).

You might also like