0% found this document useful (0 votes)
4 views3 pages

Answers PDF

The document provides instructions for creating a simple web page using HTML5 and CSS3, including elements like a header, image, paragraph, hyperlink, and footer. It specifies styling requirements such as background color, text alignment, image dimensions, font style, and footer padding. Additionally, it includes a JavaScript program that prompts the user for a number and displays messages based on the input using a do...while loop.

Uploaded by

floospart1
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)
4 views3 pages

Answers PDF

The document provides instructions for creating a simple web page using HTML5 and CSS3, including elements like a header, image, paragraph, hyperlink, and footer. It specifies styling requirements such as background color, text alignment, image dimensions, font style, and footer padding. Additionally, it includes a JavaScript program that prompts the user for a number and displays messages based on the input using a do...while loop.

Uploaded by

floospart1
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

Q1

Write HTML5 and CSS3 code to create a simple web page that includes the
following elements:
1. A header that displays the text "Welcome to My Webpage."
2. An image of your choice.
3. A paragraph of text below the image.
4. A hyperlink to a valid absolute URL.
5. A footer that displays your name, the copyright symbol, and the current
year.
Apply the following styles:
• Use an external stylesheet linked to the HTML document.
• Choose any color for the page background, except for white and black.
• Center-align the header text.
• Set the image's width to 450px and height to 300px.
• Use Arial font for the paragraph text, with a font size of 18px.
• Use a padding of 24px for both the top and bottom of the footer.

Note: You must provide your answer here and attach any necessary files and
screenshots to support your submission.
Answers:

Q1a: A header that displays the text "Welcome to My Webpage."


<header>

<h1>Welcome to My Webpage</h1>

</header>

Q1b: An image of your choice.


<img src="https://encrypted-
tbn1.gstatic.com/images?q=tbn:ANd9GcQikedL1LnvKMIWq0L5TKbEthOz6
oAfVe792jIasQA5t1cycpORqQKILmv8BSgKa3esTSwzLZG8d-
GANdw7H0ZHG3o2mEptX697-4RFV5w" id="myImage">

Q1c: A paragraph of text below the image.


<p>the image above. It's a beautiful landscape scene. the text is in Arial
font and a size of 18px. </p>
Q1d: A hyperlink to a valid absolute URL.

<a href="index.html">Visit my webpage</a>

Q1e: A footer that displays your name, the copyright symbol, and the
current year.

<footer>

© Dania Bader Alrubeaan, 2025

</footer>

Q1f: Use an external stylesheet linked to the HTML document.

<link rel="stylesheet" href="styles.css">


Q1g: Choose any color for the page background, except for white and
black.

body {

background-color: #f0e68c; /* Example: khaki */


}

Q1h: Center-align the header text.

header {

text-align: center;

Q1i: Set the image's width to 450px and height to 300px.

#myImage {

width: 450px;

height: 300px;

Q1j: Use Arial font for the paragraph text, with a font size of 18px.
p{

font-family: Arial, sans-serif;

font-size: 18px;
}
Q1k: Use a padding of 24px for both the top and bottom of the footer.

footer {

padding-top: 24px;

padding-bottom: 24px;

text-align: center;
}

Q2

write a JavaScript program that uses a do...while loop to continuously prompt


the user to enter a number. If the user enters a number greater than 15, display
“Number is greater than 15!” on the webpage and exit the loop. Otherwise,
display “The number is less than or equal to 15. Try again!” on the webpage and
prompt the user for another number. The loop should continue until the user
enters a number greater than 15.

Note: You must provide your answer here and attach any necessary files and
screenshots to support your submission.

Answer:

do {
let userInput = prompt("Enter a number:");
let number = parseFloat(userInput);

if (isNaN(number)) {
document.write("Invalid input. Please enter a valid number.<br>");
continue;
}

if (number > 15) {


document.write("Number is greater than 15!<br>");
break;
} else {
document.write("The number is less than or equal to 15. Try again!<br>");
}
} while (true);

You might also like