Hello,

Can anyone help me fix this error?

I am trying to fix my code after validating the code according to international standard:

https://validator.w3.org/nu/?doc=http%3A%2F%2Fwww.innovation.web.id%2FOne%2F

Error: Stray start tag div.

From line 180, column 1; to line 180, column 20

↩</body>↩↩<div id="footerbar">↩<div

footer.php

    <div id="footerbar">
<div class="row">


<div class="col-sm-4">
<div id="footer">

<div id="inside">
<br>
<h4>Newsletter</h4>
<p>Please enter your email address to subscribe to our newsletter</p>
<input type="text"><input type="submit" value="OK">

</div>
</div>
</div>

<div class="col-sm-4">
<div id="footer">

<div id="inside">
<br> 
<h4>Follow Us</h4>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec suscipit molestie diam, at faucibus nibh consectetur tempus.</p>
<br>
<a href="#"><img src="Images/About/twitter.jpg" height="40"></a>
<a href="#"><img src="Images/About/fb.jpg" height="40"></a>
<a href="#"><img src="Images/About/googleplus.jpg" height="40"></a>
</div>

</div>
</div>


<div class="col-sm-4">
<div id="footer">

<div id="inside">
<br>
<h4>Contact Us</h4>

<table>
<tr>
<td style="width:90px;">Nama      :</td>
<td style="color: black;"><input type="text" name="nama" size="22"></td>
</tr>
<tr>
<td style="width:90px;">Message   :</td>
<td style="color: black;"><textarea rows="5" cols="19"></textarea></td>
</tr>
</table>

<!--
<p>Address: 25, Lomonosova St. Moscow, Russia, 665087</p>
<p>Phone: (888) 888-8888
<p>Email: info@rosetta.com
-->

<br><br>

</div>
</div>
</div>

</div>
</div>

Dani AI

Generated

is on the right track: a stray start tag usually means the parser has already closed the body, then it finds another element. In your case, footer.php is being included after </body>. Make sure the include order in your main template is: page content -> footer include -> scripts -> </body> -> </html>.

A few quick cleanups while you are there:

  • Keep a single footer container. You have three id="footer" blocks; IDs must be unique. Use one <footer id="footer"> and classes inside it (e.g., class="footer-section").
  • Wrap the newsletter and contact blocks in real <form> tags with action, method, and proper <label>s. Use type="email" for the newsletter field.
  • Add alt text to images and avoid using <br> for spacing; use CSS margins instead.
  • Keep the bootstrap grid structure valid: .row directly contains your .col-sm-4 columns.

Bottom-of-page example (template), showing the correct order:

<!-- page content -->
<div id="content">...</div>

<!-- footer goes inside the body -->
<?php include 'footer.php'; ?>

<!-- scripts that can load after content -->
<script src="/js/app.js"></script>

</body>
</html>

And inside footer.php, prefer something like:

<footer id="footerbar">
  <div class="row">
    <div class="col-sm-4 footer-section">
      <form action="/subscribe" method="post">
        <h4>Newsletter</h4>
        <label for="email">Email</label>
        <input id="email" name="email" type="email" required>
        <button type="submit">OK</button>
      </form>
    </div>
    <!-- ...other columns... -->
  </div>
</footer>

After moving the include and tidying IDs/forms, revalidate; the stray tag error should disappear.

Hello,

move the </body> tag to the end of the page, just before the </html> tag. An HTML document is composed two main sections, head and body:

<html>

    <head>
        <title>Test</title>
    </head>

    <body>

        <!-- content area -->

        <h1>Hello</h1>
        <p>Bla bla bla</p>

        <!-- end of content area -->


        <!--
            Area where to start scripts
            that can to be loaded after
            page content is loaded, the
            equivalent of $(document).ready()
            in jQuery.
        -->
        <script>
            ...
        </script>
        <!-- end of javascript area -->

    </body>

</html>

The head section is used to define the document type, encoding and the resources to load such as scripts, fonts and styles possibly before rendering the content of the body section. Whatever you don't code inside the head section must to be placed in the body section. You must not write code outsite of these boundaries.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.