Question

1. Create an HTML file that uses an alert dialog box to display the message Hi There! when the page loads 2. Create an HTML

Homework 8   Re-write this code using a style sheet not in-line styles

<html> <head><title>position</title>

</head>

<body>

<img src= "snow.jpg" style="positon: absolute; top:0px; left: 0px; z-index: 1">

<img src="nagano_1.jpg" Style = "position: absolute; top:70px;

left: 150px; z-index:2">

<h1 style= "position: fixed; top:50px; left: 50px; color:2338ee; z-index:3";>

this is a test of position</h1>

</body></html>

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1)HTML page displaying the message 'Hi There!' at loading:

1 2 3 4 5 6 7 8 9 10 first.html x <!DOCTYPE html> <html> <head> <title>position</title> <script> alert(Hi There!); </scriptOutput:

first.html х + → X File | C:/Xampp/htdocs/test/first.html This page says Hi There! OK

3 position X + File | C:/xampp/htdocs/test/first.html ulls is test of position

SOURCE CODE:

<!DOCTYPE html>
<html>
<head>
   <title>position</title>
<script>
   alert("Hi There!");
</script>
</head>
<body>
   <img src= "snow.jpg" style="positon: absolute; top:0px; left: 0px; z-index: 1">

   <img src="nagano_1.jpg" Style = "position: absolute; top:70px; left: 150px; z-index:2">

   <h1 style= "position: fixed; top:50px; left: 50px; color:2338ee; z-index:3";>this is a test of position</h1>
</body>
</html>

2) HTML page displaying grades and score

X 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 first.html <!DOCTYPE html> <html> <head> <title>position</ti

position Х + x File | C:/xampp/htdocs/test/first.html This page says Please enter test score OK Cancel

C position X + File | C:/xampp/htdocs/test/first.html This page says Please enter test score 89 ОК Cancel

position X + File | C:/xampp/htdocs/test/first.html This page says Grade: B OK

3 position X + File | C:/xampp/htdocs/test/first.html ulls is test of position

SOURCE CODE:

<!DOCTYPE html>
<html>
<head>
   <title>position</title>
<script>
   var TestScore = prompt("Please enter test score", " ");
   var testScoreGrade;
if(TestScore >= 90 && TestScore <= 100)
   testScoreGrade = 'A';
else if(TestScore >= 80 && TestScore <= 89)
   testScoreGrade = 'B';
else if(TestScore >= 70 && TestScore <= 79)
   testScoreGrade = 'C';
else if(TestScore >= 60 && TestScore <= 69)
   testScoreGrade = 'D';
else if(TestScore < 60)
   testScoreGrade = 'F';

   alert("Grade: "+testScoreGrade);

</script>
</head>
<body>
   <img src= "snow.jpg" style="positon: absolute; top:0px; left: 0px; z-index: 1">

   <img src="nagano_1.jpg" Style = "position: absolute; top:70px; left: 150px; z-index:2">

   <h1 style= "position: fixed; top:50px; left: 50px; color:2338ee; z-index:3";>this is a test of position</h1>
</body>
</html>

EXPLANATION:

Generally,in HTML with the help of javascript we can popup the message using global functions like - alert(), prompt() and confirm().

alert() - With 'OK' button displays a popup message on the screen.

confirm() - With 'OK' and 'Cancel' buttons popup a message and takes the user confirmation for proceeding.

prompt() - Takes the input message and displays the output through popping up the message.

Please note that I have taken some samples from internet and I'm displaying those as per the requirement here.

Add a comment
Know the answer?
Add Answer to:
Homework 8   Re-write this code using a style sheet not in-line styles <html> <head><title>position</title> </head> <body>...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 6. (HTML) Given the following HTML document: <html> <head> <title>Grandma Cafe</title> </head> <body> <h1>Menu</h1> <ol> <li>Café...

    6. (HTML) Given the following HTML document: <html> <head> <title>Grandma Cafe</title> </head> <body> <h1>Menu</h1> <ol> <li>Café Latte</li> <li>Café Mocha</li> <li>Cappuccino</li> </ol> <img src="https://businessexchange.ca/wp-content/uploads/2018/05/coffee- shop-1.jpg" /> </body> </html> a. [4] Sketch approximately how it will be displayed in a web browser. (For media items such as images, just draw a box labelled with the media type.) b. [2] What is the protocol, hostname, top-level domain name, and file name of the image being linked here?

  • <!-- DOCTYPE declaration --> <!DOCTYPE html> <!-- HTML boilerplate code --> <html lang="en">    <!-- head...

    <!-- DOCTYPE declaration --> <!DOCTYPE html> <!-- HTML boilerplate code --> <html lang="en">    <!-- head tag -->    <head>                 <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Personal Webpage</title>    </head>    <!-- body tag -->     <body>             <style>        .sidenav {            height: 100%;             width: 160px;            position: fixed;            z-index: 1;             top: 0;            left: 0;           ...

  • <!-- DOCTYPE declaration --> <!DOCTYPE html> <!-- HTML boilerplate code --> <html lang="en">    <!-- head...

    <!-- DOCTYPE declaration --> <!DOCTYPE html> <!-- HTML boilerplate code --> <html lang="en">    <!-- head tag -->    <head>                 <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Social</title>    </head>    <!-- body tag --> <body>                 <style>        .sidenav {            height: 100%;             width: 160px;            position: fixed;            z-index: 1;             top: 0;            left: 0;            background-color:...

  • As part of this assignment we are using the base Gallery HTML and writing JavaScript code...

    As part of this assignment we are using the base Gallery HTML and writing JavaScript code that will: 1) preload the images provided to us, 2) Create rollover functionality for each of the thumbnails in your image gallery 3) Use appropriate images found in the images folder. 4) Write developer comments to describe the variables being declared and explain the functions and logical blocks of JavaScript code pertaining to the gallery. I know it has to be an external JS...

  • Look at the following illustrated output for an HTML and a css given below <!DOCTYPE html>...

    Look at the following illustrated output for an HTML and a css given below <!DOCTYPE html> <head> <title>TABLE with STYLE SHEET</title> <meta charset="utf-8" /> <meta name="description" content="Godaddy Webpage original" /> <link rel = "stylesheet" href="GoDaddy_assignment_1.css"> <body> <img src= "GoDaddy.png"/> <p>Welcome to:<strong>webhamster.com</strong></br> This web page is parked<strong>Free</strong>courtesy of <a class="aclass1" href ="https://www.godaddy.com">GoDaddy.com</a></p> <h1>Want to buy<span class ="span2">webmaster.com ?</span></h1> <div class ="div1"> <a class ="aclass2" href="https://www.godaddy.com">Learn How</a> </div> </hr> <button>Search Ads</button> </body> </html> “ QUESTION continued Given the corresponding css file .aclass1{color:purple;}...

  • Javascript to edit a HTML file. Where to begin? <!doctype html> <html>    <head>      <meta charset="utf-8">      <title>TODO:...

    Javascript to edit a HTML file. Where to begin? <!doctype html> <html>    <head>      <meta charset="utf-8">      <title>TODO: Change The Title</title>    </head>    <body>      <h1></h1>      <p>First paragraph.</p>      <p class="intro">Second <span>paragraph</span>.</p>      <button id="start">Start</button>      <main> </main>      <!--       Test 6: DOM Programming       You MAY consult the notes for week 7, but you MAY NOT discuss this test or       your code with any other students.  All work must be your own.       Instructions:              1. Put all solution code in a file named solution.js.  When you upload your          solution to...

  • HTML and css using notepad++ WHen you run the code, you will see a horizontal menue...

    HTML and css using notepad++ WHen you run the code, you will see a horizontal menue with several options. I want a small horizontal line between each option. I also want that done using div inside a div. Thank you <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Title of the document</title> <style> body{ background-color:#FFA07A; } #h1{ color:white; text-decoration:none; padding:30px; } #h2{ color:white; text-decoration:none; padding:30px; } #navbar1{ background-color:grey; text-align:center; font-size:35px; height:100%px; border:1px solid black; position:absolute; text-decoration:none; margin-left:300px; } #h3{ color:white; text-decoration:none; padding:30px;...

  • <!DOCTYPE html> <html> <head> <title>Products</title> <style> .heading { text-align: center; font-size: 40px; } #menu { text-align:...

    <!DOCTYPE html> <html> <head> <title>Products</title> <style> .heading { text-align: center; font-size: 40px; } #menu { text-align: center; } #menu li { display: inline; font-size: 26px; margin-left: 20px; } .container{ overflow: hidden; margin: 30px; } img { float: left; width: 40vh; height: 40vh; margin-left: 10%; } table { float: right; margin-right: 10%; } table, th, td { border: 1px solid black; border-collapse: collapse; } th, td { font-size: 26px; padding: 10px; text-align: left; } a { color: black; } a:visted {...

  • I'm having trouble to link the .js file to the html so changes for the html...

    I'm having trouble to link the .js file to the html so changes for the html to be made in the .js file <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>:JavaScript, HTML and jQuery</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <!-- this is so I don't have to give you a separate CSS file --> <style>     .hidden {display: none;}     .menu { width: 100px;} </style> </head> <body> <div class="container"> <h1>Assignment 2: JavaScript, HTML and jQuery</h1> <p>To complete this...

  • <!DOCTYPE HTML> <html lang="en"> <head>    <meta charset="utf-8"> <title>Plaid Scarf Selector</title>    <link rel="stylesheet" href="a3.css" />...

    <!DOCTYPE HTML> <html lang="en"> <head>    <meta charset="utf-8"> <title>Plaid Scarf Selector</title>    <link rel="stylesheet" href="a3.css" />    <script src="a3.js"> </script> </head> <body>    <section>        <h1> Plaid Scarf Selector </h1><br>        <p>Feels close to real cashmere (but costs a lot less).        Think of this scarf as the next best thing to wearing authentic cashmere.        Its microsueded fabric really is that soft. In fact, at first touch some        mistake if for the real...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT