Looking for closing tags in html

So i have this huge html file with lots of css that i’ve inherited and now i’m trying to make sure that the opening tags all have matching closing tags. which software will do this best and help me keep track.

It’ll help you validate your files.

If the CSS is inline in the HTML you might want to consider migrating the CSS to an external CSS file.

yes i have a ton of inline css. and when i validate it, it screws it up big time.

I’m getting a huge headache while using sublime.

Also trying to figure out what the best way to align a bunch of javascript widgets on the page.

3 widgets on the left and 2 widgets on the right.

not sure if i should use a float or positioning?

also some of the javascript apparently is overriding styles because there are embedded style sheets in the javascript apparently.

It’s a real headache. any tips would be useful.

Perhaps post a link, as otherwise we’re in the dark.

Did you try the validator I posted? They tell you the errors.

If and only if you are using Php then try this neat feature where it is possible to isolate complete sections, remove errors then include the next section which has errors.

<body>

<header>
   header stuff to eliminate errors
</header> 

<?php if(false): /* The following script will not be displayed */ ?>
   <content>
     <!-- content with errors -->
    </content>

    <footer>
      <!-- footer with errors -->
    </footer>  
<?php endif; ?>

</body></html>

what i want to know is are there any good code editors that track down the closing tag ?

Because for example, if you have a thousand line html file and you have a ton of divs and you need to make sure one of them has a matching closing div, how would you go about doing so?

Then also is there a way to find out which css styles are not needed in the webpage? and have them eliminated from my code because it is making my coding experience horrible.

Also what to do when you have hundreds of css class selectors with vague naming conventions, how would you go about figuring that out?

i would post the link but this is for a job interview. so i’m refraining from that.

One thing that’ll help, as you work your way through the code, as you reach an opening tag, depending on what it’s a tag for, you might want to start a new line and indent it by a tab until you reach the corresponding closing tag

I use Bluefish. If you highlight the opening div tag (or any other tag) in the code, it will automatically highlight the matching closing tag. It will also let you “collapse” the code for a block-level element, which can be helpful at times. e.g. From this:

to this:

I would guess other editors do this, too.

I’m not sure if this is quite what you mean, but this topic might help:

(After reading that topic, I’ve been using Dust-Me Selectors and found it very useful.)

Yes, Notepad++ highlights matching tag pairs when you click on one of them.
Personally, I rely heavily on indenting for both mark-up and code blocks to make it easier for me to see what’s nested.

There are probably text editors that have auto-complete tag generation, but I know for a fact a few IDEs have the feature. In fact you could probably import all your files into a “project” and have them all auto-formatted with a click. I don’t know if they’d report any mal-formed mark-up, but they might.

Of course whether or not you want to learn an IDE or not depends on how often you’ll use it, but IMHO it would be worth looking into.

The best thing to do is to check them manually. So if you’re using Dreamweaver. You can use > Apply source formatting so it’s easier to find opening and closing tags.

Thanks everyone. The tips are useful, i will look into it further next time i have a coding challenge.

use notepad++ and also use an external style sheet (css)
after that use the w3c validator it will show u exactly where u made mistakes
if u are not a fan of the w3c validator u can use the find facility in notepadd++ and check