Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
0

Tag must be paired error, Beginner's question

New Here ,
Apr 21, 2017 Apr 21, 2017

this is my first attempt at a web page so maybe I am missing something. ive checked over and over again..

I'm getting the error message,

"tag must be paired, missing [</div> </div> </div> </div>] start tag match failed [<div>] on line 38

line 38 is <div><div id="content">

am I missing something????

<!doctype html>

<html>

  <head>
  <link href="css/styles.css">
  </head>

<body><div>
 
  <div id="banner"> <img src="images/LDR banner.jpg">
  </div>
 
   

<div>
<div id="header">
  <h1>Highly Addictive Content</h1>
  </div>
 

  <div>
   <div id= "navigate">
   <ul>
    <il><a href="index.html">Home</a></il>
   
    <il><a href="lease.html">Lease</a></il>
    
    <il><a href="exclusive.html">Exclusive</a></il>
   
    <il><a href="mailinglist.html">Mailing List</a></il>
   
    <il><a href="contactus.html">Contact Us</a></il>
   
   </ul>
  </div>
 
  <div><div id= "content">     
  <p>Shop for high quality beats for lease. </p>
  <p>Various Styles and sounds to add mixed flavor to any project from original hip hop to trap music. </p>
  <p>Get exclusive beats made upon request and worked on to your satisfaction. </p>
  <p>Join our mailing list for promos and updates.</p>
  <img src="images/ldr logo 2 web.png"></div>
  </body>

  </html>

TOPICS
Error , Product issue
36.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 21, 2017 Apr 21, 2017

To code for an HTML page you must have a working knowledge of HTML.

One of the first things one learns when being taught to code, is that most (and not all) elements in HTML require an opening tag and a corresponding closing tag. In other words, when you have a <div> tag you must also have a </div> tag to complete the element.

Look through your document, count the <div> tags and the </div> tags and you will see a discrepancy of at least three.

Translate
Community Expert ,
Apr 21, 2017 Apr 21, 2017

To code for an HTML page you must have a working knowledge of HTML.

One of the first things one learns when being taught to code, is that most (and not all) elements in HTML require an opening tag and a corresponding closing tag. In other words, when you have a <div> tag you must also have a </div> tag to complete the element.

Look through your document, count the <div> tags and the </div> tags and you will see a discrepancy of at least three.

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 09, 2025 Jan 09, 2025

how would one count the tags when the html page is long?  Sorry for the noob question.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 09, 2025 Jan 09, 2025

You don't count tags. The page needs to be structured so that it is obvious if a tag is missing.

 

This is part of @Nancy OShea's answer

 

BenPleysier_0-1736475034236.png

 

This uses semantic sectioning elements to give the page a structure.

 

For more, see one of my videos:

https://youtu.be/Zy4yJz1icrw?si=mpumfkLqKFZm3lPb

 

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Apr 22, 2017 Apr 22, 2017

Ben answered your question. I just have a point of advice:

Do not use spaces in file names, even if it works:

<div id="banner"> <img src="images/LDR banner.jpg">

  <img src="images/ldr logo 2 web.png"></div>

Have a set of rules for naming files, form fields, and variables. My rules are:

  • Never use uppercase unless you have a strong reason to
  • Never use spaces (with variables you would get an error message anyway)
  • Use underscore to separate words in variables and fields ($my_form_field) but dashes in file names (my-form-field.html)
  • Use verbose names that describe the element (last_name, not ln)
  • Be extremely consistent. (not last_name in one place and WorkType in another)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 22, 2017 Apr 22, 2017

Learn to use HTML5 semantic tags.

These tags will  cut down on the Divs  and give more meaning to your content which is good for search engines and web accessibility.

Image result for HTML5 semantic tags

CSS tips:

Avoid using unique #IDs unless you need to specifically target them for an action.

Most of the time a semantic tag will get the job done -- header, nav,  li, etc...

And the rest of the time a re-usable .class_name is all that's needed.

Nancy

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jan 21, 2025 Jan 21, 2025
LATEST

Wow, I did not notice the necro thread. Forget what I wrote. 🙂

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines