简体   繁体   中英

"Start tag body seen but an element of the same type was already open" & can't figure out how to center horizontally?

I'm really new at this so I'm sure this is a simple mistake- could someone help me figure out what I'm doing wrong? I can't seem to center my content, and my code is invalid. I'm thinking it's a nesting error, but I'm not sure.

(There's also an error stating that my "align" attribute is obsolete, which my teacher is telling me to ignore for the time being)

 <!DOCTYPE html> <html lang="en"> <link rel="stylesheet" type="text/css" href="javajam.css"> <title>JavaJam Coffee House</title> <header> <h1><img src="javalogo.gif" alt="JavaJam Coffee House" width="700" height="100"></h1> </header> <body> <div class="wrapper"> <nav> <a href="index.html">Home</a>&nbsp; <a href="menu.html">Menu</a>&nbsp; <a href="music.html">Music</a>&nbsp; <a href="jobs.html">Jobs</a>&nbsp; </nav> <main> <img src="windingroad.jpg" alt="Winding Road" height="154" width="333" align="right"> <ul> <li>Specialty Coffee and Tea</li> <li>Bagels. Muffins and Organic Snacks</li> <li>Music and Poetry Readings</li> <li>Open Mic Night</li> </ul> </main> <div> 12312 Main Street <br>Mountain Home, CA 93923 <br>1-888-555-5555 </div>&nbsp; <footer> Copyright &copy; 2014 JavaJam Coffee House <br>ari.levy@gmail.com </footer> </div> </body> </html>

Your <header> tag is on a wrong place and you miss the <head> tag

Example:

<!DOCTYPE html>
<html>
<head>

  <link rel="stylesheet" type="text/css" href="javajam.css">
  <title>JavaJam Coffee House</title>

</head>

<body>

.....

<!-- Place your <header> tag between the <body> tag -->

.....


</body>
</html>` 

More Info

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM