When in doubt, it’s div

I have a habit of periodically throwing all my code in a validator because I live in fear of finishing what I think is the perfect site and then going to validate it and finding 10 million problems with my code. I started my third page yesterday and got it to the point where it wasn’t finished but was looking pretty good overall. Perfect time to throw it in the validator, I thought. So I copy and paste, and bam. There are 21 errors. On my other pages, I had maybe 4-5 tops. So I start scrolling through my code, but nothing looked obviously wrong. I found a <p> tag I had accidentally closed with <p> instead of </p>, but that didn’t cause all 21 errors. I start googling the error messages because I only kind of understood what they meant (I hope everyone has discovered the magic of stack overflow by now, by the way) but those suggestions didn’t work.

Then I realized that basically all the errors were in the middle of the code, where I start to go kind of <div> crazy. “Eff it,” I thought, “Let me just stick a few more </div>s at the bottom of the page and see what happens.” I run it again. I get the beautiful beacon of green. Two missing </div>s caused 20 errors.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s