How to find invalid code in Dreamweaver

there is some line of code in my html page that must be invalid, because the colors of the markup are showing different colors than what they are supposed to be in DW. How would I find out where my invalid code is in hundreds of line of text in Dreamweaver?

There is the menu item “File” > “Check Page” > “Validate Markup”.

Or you could try this:

You could perhaps check what the W3 Validator says is invalid or displays warning for. I tend to go through mine quite thoroughly line by line to make sure I have as few errors as possible though.

Could? Who doesn’t?

make sure I have as few errors as possible though.

Few as possible? How about none? Out of all the pages I’ve created over the years, they are all 100% valid and standards compliant.

I agree with Dan and doc. DW is just one of many “attempts” at code validation. Use the real one at http://validator.w3.org/

If you haven’t used it before, it will confirm whether your page is compliant with your doctype and if not, give you a very good point by point list of the problems it finds. It’s the first best debugging tool to use when you’re having HTML problems. If you’re having trouble with appearance/presentation then I’d validate your stylesheet too. http://jigsaw.w3.org/css-validator/

That’s the easiest thing you can do to test drive your pages.

I only say could because he doesn’t have to, it’s merely a suggestion. As for errors I bet most pages have at least one error, perhaps not from the W3 Validator but from earlier browsers which don’t support certain things that are still used.

Feeding older browsers with invalid markup doesn’t make sense. Besides, there is no need to bother with browsers that old.

This is why I recommended using DW’s built in validator in this instance. It will generally be easier to find out what DW is complaining about by going through its own validator, especially if it’s wrong and shouldn’t be complaining at all, in which case a real validator won’t help find the “problem”.

The funny thing is that I did use DW’s validator before asking this question. It didn’t sniff out the culprit at all. but then I realized that all I had to do was go to the area where the markup colors were “misbehaving” and look around that area. I eventually found the issue was only 2 lines above me- I had included an extra " around a selector when I shouldn’t have.