Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.

    GIF shows where to locate </> in the thread and or post editor toolbar.
    To learn more about how to use our BBCode feature, review our "How to post your code into threads" here.

    Thank you, Code Forum.

HTML & CSS HELP

Why am I getting this parse error?



Code:
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Title</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<style>
  </head>
   body {
      font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
   }
   * {
      box-sizing: border-box;
   }
   .eka, .toka, .kolmas, .neljäs {
      float: left;
      width: 50%;
      color: white;
      padding: 10px;
      height: 500px;
      text-align: center;
   }
   .eka {
      background-color: tomato;
   }
   .toka{
      background-color: teal;
   }
   .kolmas {
      background-color: rgb(166, 71, 255);
   }
   .neljäs {
      background-color: rgb(255, 71, 194);
   }
   .container:after {
      clear: both;
   }
</style>
</head>
<body>
<h1 style="text-align: center;">LOREM IPSUM ;)</h1>
<div class="container">
<div class="eka">
<h1 style="color:yellow;">Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed id tempus diam. Pellentesque vestibulum pharetra erat nec auctor. Sed quis pulvinar</h1>
</div>
<div class="toka">
<h1 style="color:blue;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc egestas condimentum dui, sit amet volutpat augue. Sed eu odio eu nunc vulputate suscipit sit amet at sapien. Nam mattis semper metus ac viverra.  </h1>
</div>
<div class="kolmas">
<h1 style="color:purple;">Suspendisse rutrum nunc in odio consectetur, vitae dictum diam eleifend. Vivamus tristique neque felis. Phasellus in risus sed libero scelerisque maximus. Duis at dui elementum, condimentum eros quis, placerat ex.</h1>
</div>
<div class="neljäs">
<h1 style="color:red;">Ut bibendum dui lorem, vitae placerat urna venenatis ut. Donec euismod accumsan vehicula. Proin vel porta libero. Sed aliquet tincidunt tempus. Nulla ut gravida tortor.</h1>
</div>
</div>
<a href="http://page2/">TOKA</a>
</body>
</html>
 
You have two closing </head> tags, thats why this error is. Remove the </head> above <style> tag.
HTML:
<!DOCTYPE html>

<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <style>
        * {
            box-sizing: border-box;
        }
        body {
            font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
        }
        .eka, .toka, .kolmas, .neljäs {
            float: left;
            width: 50%;
            color: white;
            padding: 10px;
            height: 500px;
            text-align: center;
        }
        .eka {
            background-color: tomato;
        }
        .toka{
            background-color: teal;
        }
        .kolmas {
            background-color: rgb(166, 71, 255);
        }
        .neljäs {
            background-color: rgb(255, 71, 194);
        }
        .container:after {
            clear: both;
        }
    </style>
</head>

<body>
    <h1 style="text-align: center;">LOREM IPSUM ;)</h1>
    
    <div class="container">
        <div class="eka">
            <h1 style="color:yellow;">Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed id tempus diam. Pellentesque vestibulum pharetra erat nec auctor. Sed quis pulvinar</h1>
        </div>
        <div class="toka">
            <h1 style="color:blue;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc egestas condimentum dui, sit amet volutpat augue. Sed eu odio eu nunc vulputate suscipit sit amet at sapien. Nam mattis semper metus ac viverra.  </h1>
        </div>
        <div class="kolmas">
            <h1 style="color:purple;">Suspendisse rutrum nunc in odio consectetur, vitae dictum diam eleifend. Vivamus tristique neque felis. Phasellus in risus sed libero scelerisque maximus. Duis at dui elementum, condimentum eros quis, placerat ex.</h1>
        </div>
        <div class="neljäs">
            <h1 style="color:red;">Ut bibendum dui lorem, vitae placerat urna venenatis ut. Donec euismod accumsan vehicula. Proin vel porta libero. Sed aliquet tincidunt tempus. Nulla ut gravida tortor.</h1>
        </div>
    </div>
    
    <a href="http://page2/">TOKA</a>
</body>

</html>
 

Buy us a coffee!

Buy me a coffee.
Back
Top Bottom