How to make logo on the top page

I’ve tried many times to make the logo to the top after putting a blue background, it’s become like this:


and it needs to look like this:
HTML:

<html>
<div id="logo">
</div>
<head>
	<title>Assignment 1- Register</title>
	<link rel="stylesheet" type="text/css" href="css/KingLib2_.css"/>
</head>

<body>
<br/>

  <div id="logo">
	  <img src="KingLibLogo.jpg" alt="King Real Estate Logo"> 
	  <div id="h3">
	  <div id="right">
	  <h3>Please sign up</h3> 
	  
     </div> </h3>


<form method="post" action="assignment_2_add_patron.php">

	<p>
	
	    First Name:<br/>
		<input type="text" name="firstname" size="30"/> <br/>
	</p>
     
	<p>
		Last Name:<br/>
		<input type="text" name="lastname" size="30"/> <br/>
	</p>

	<p>
		Email:<br/>
		<input type="text" name="email" size="35"/> <br/>
	</p>
      
	  <p>
	  
	   Birth Year:<br/>
	   <input type="text" name="birthyear" size="35"/> <br/>
	   
	   </p>
	<p>
	   City of Residence<br/>
	  <select name="cityofresidence" size="1">
	  <option value="--">--</option>
	  <option value="Chicago">Chicago</option>
	  <option value="Detroit">Detroit</option>
	  <option value="Toronto">Toronto</option>
	  </select>
	  </p>
	  
	  
	<p>
	<input type="submit" value="Submit Information"/>
	</p>

</form>

</body>
</html>

PHP:

<!DOCTYPE HTML>

<html>
<head>
	<title>Thank You for Registering!</title>
	<link rel="stylesheet" type="text/css" href="css/KingLib2_.css"/>
</head>

<body>
<br/>

 <div id="logo">
	  <img src="KingLibLogo.jpg" alt="King Real Estate Logo"> 
	  <div id="h3">
	  <h3>Thank You for Registering!</h3>
	  
     </div> </h3>

<?php
	$firstname = $_POST['firstname']; 
	$lastname = $_POST['lastname']; 
	$email = $_POST['email']; 
	$cityofresidence = $_POST['cityofresidence']; 
	$birthyear = $_POST['birthyear'];
	$current_year = date('Y');
	$age = $current_year - $birthyear;

	print "<p>Name: $firstname $lastname"; 
	print "<p>Email: $email"; 
	print "<p>City: $cityofresidence"; 
	print "<p>Birth Year: $birthyear";
	
	if ($age > 55) {
	
		print"<p>Section: Senior</p>";
	}
	if ($age < 54) {
	
        print"<p>Section: Adult</p>";
	
	} if ($age < 14 ) {
		 
		 
	    print"<p>Section: Child</p>";
		
	 }
	


?>

</body>
</html>

CSS:

html {margin:0; padding:0;}

#logo{
	position: absolute;
    top: 100px;
    left: 20px;
    width: 350px;
	height: 650px;
	padding: 10px;
	background-color: #E6E6FA;
}

}
#h3 {

font-family: Arial, Helvetica, sans-serif;
color: black;
background-color: #E6E6FA;
right: 50px;
}

 body { 
    font-family: Arial, Helvetica, sans-serif; 
	color: black; 
	background-color: #F0E68C; 
}

p {
	font-size: 16px;
}

input {
	font-size: 16px;
}

select {
	font-size: 16px;
}

textarea {
	font-size: 16px;
	font-family: Arial, Helvetica, sans-serif;
}

#logo{
position : absolute ;
top : 0;
right:0;
left:0
}

This is most easy using the CSS
Use the hashtage to channel this.
First you need to set the position.
I ussualy use absolute so it avoids other elements.
Then the coordinates.
which are ussualy defined with
top, right, left and bottom
also an easy one is just using position top left see link bellow for more info:
https://www.w3schools.com/css/css_positioning.asp

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.

markdown_Forums