views:

26

answers:

3

ive been editing a lot of html pages with basic text editor, notepad. and now when i went to validate them the validation service is saying theres a div tag that is not closed. i tend to find automatic error reports such as these dont tend to be too reliable, i.e they will give you a line number and the error but often times the error is actually in another part of the file entirely.

im just wondering if theres any free lightweight html editors that have the functionality of finding the closing tag for a tag, eg you click on a tag then click a shortcut, and the program will jump to the closing tag, i know this functionality is in homesite, but i dont have homesite, and its a bit of a bulky program anyway.

or even better any online html validation services that can highlight unclosed tags.

so to sum up, i would like to know how to find html tags that dont have closing tags - is there a free html editor or simple online service that can help with this? cheers.

+1  A: 

If you save your HTML as page.xhtml (instead of page.html), the browser (Firefox/Chrome or Opera) should find the un-closed tags for you without the need for a validator. Just remember to rename them .html before serving them online - IE doesn't support .xhtml files yet.

lucideer
wow, cool tip, i will try it!
+1  A: 

http://validator.w3.org/

Does more than just unclosed tags. Should be used by all front-end developers, IMO.

Jason McCreary
If I understand him correctly I think he said he's already using the validator and is looking for a local alternative.
lucideer
i should have mentioned, that this is the service i used that found the error in the first place, it found the unclosed tags, but im finding it hard to track down the actual tag that is not closed, maybe im just not reading the error report right
Try to checking the 'Show Source' and it should help. If your page contains several errors, this validator can choke out and the report isn't as helpful. Depending on your IDE though the syntax highlighting and/or tag collapsing should get you the rest of the way - given that is low tech.
Jason McCreary
+2  A: 

Notepad++ - never had any problems with it and also never had any unclosed html tag with it.

You can just click on any element and see if it has a closing tag. Also you can do this: click on "TextFX"(left from plugins in navigation) -> click on "Text FX HTML Tidy" -> click on lets say hmm "TiDy clean Document - wrap". That should fix your html document, aka close all unclosed elements.

GaVrA
thanks! i will try it, i actually have it installed, but didnt know it could do this.
@mackx You can just click on any element and see if it has a closing tag. Also you can do this: click on "TextFX"(left from plugins in navigation) -> click on "Text FX HTML Tidy" -> click on lets say hmm "TiDy clean Document - wrap". That should fix your html document, aka close all unclosed elements.
GaVrA
thanks for the info! :)