Html Div tags not working

Hello I have a div tag that the program Brackets, shows in Red color, when I open the webpage locally, is not showing correctly the webpage for this reazon.

I don’t understand. i see the div tags that are in red, are well write.

A attach a picture of the code. Any body now about this? Thanks for any help

Claudia

1 Like

Hello,
I couldn’t exactly spot the div in red color you were talking about. However, the HTML code you provided already contains an error, one of the divs does not have a corresponding close tag.
First, you have a div with class flex-child green at the top then two divs, one with class caja uno & the second with caja dos, as for the final one , the one with the class caja tres, it does not have a corresponding closing tag because the editor is assuming the final div closing tag belongs to flex-child green div

Validate your HTML.

https://validator.w3.org/nu/#textarea


I would suggest you use VS Code instead. It has much better visual guides for nesting and indentation. Install the Prettier extension as well and set it to format on save. It will fail to format if you have invalid HTML structure and show the line with the issue.

Thanks Guys.

Here it is all the Code:

Header
  <p>Pellentesque habitant </p>

  <div class="flex-container">

    <div class="flex-child magenta">
      Flex Column 1



     

      <h1> Contact Us </h1> 

Name:

Email:

Message:

Submit

    </div>
    
    <div class="flex-child green">

250 Davenport Road, Toronto On M5R 1J8

<img class=”imagen-PHONE” src=“Phone simbol.svg” style="width:70px; margi-top:5px; margin-bottom:5px;>

416 319 (2247)

                  <section>

<img class=”imagen-PHONE” src=“Email simbol.svg” style="width:70px; margin-bottom:20px;margin-top:5px;/>

      <p> </p>
  
    </section>
    




</article>

hello guys. Thanks.

Here it is all the code:

<div class="wrapper">
    <header class="header">Header</header>
    <article class="main">


      <p>Pellentesque habitant </p>

      <div class="flex-container">

        <div class="flex-child magenta">
          Flex Column 1



         

          <h1> Contact Us </h1> 

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

<label for = "name" > Name: </label> <input type = "text" name = "name" id = "name" required> 

<label for = "email" > Email: </label> <input type = "email" name = "email" id = "email" required> 

<label for = "message" > Message: </label> <textarea name = "message" id = "message" required>

</textarea> <button type = ”submit” name = ”submit”> Submit </buton> </form>

        </div>
        
        <div class="flex-child green">
          

<section>

  <img class=”imagen-Place” src="Place simbol.svg" style="width:70px; margin-top:20px; margin-bottom: 5px;"/>
<p> 250 Davenport Road, Toronto On M5R 1J8 </p>
</section>

<section>

  <img class=”imagen-PHONE” src="Phone simbol.svg" style="width:70px; margi-top:5px; margin-bottom:5px;>
  <p> 416 319 (2247)</p>
</section>


                      <section>

 <img class=”imagen-PHONE” src="Email simbol.svg" style="width:70px; margin-bottom:20px;margin-top:5px;/>
          <p> </p>
      
        </section>
        
    
  
   

    </article>

Check all your inline styles because you dont have a ending quote after your last style. You have that issue in a couple places

Thanks. Cody.

I will check up