T
6

100 lines of code and I completely broke my website

I was working on a basic HTML page for a class project (nothing crazy, just a personal blog page) and I added my 100th line of CSS. The entire layout just exploded - everything shifted to the left and the footer ended up in the middle of the page. Turns out I forgot to close a div tag like 30 lines up and that messed up all my box models. I spent 2 hours going through each line one by one until I found it. Has anyone else had a tiny mistake like a missing bracket completely wreck their whole site?
2 comments

Log in to join the discussion

Log In
2 Comments
kelly_hart28
Oh man I feel your pain so much... what finally helped me was using an HTML validator tool actually. I kept losing my mind staring at code until I just pasted it into the W3C validator and it pointed right to the unclosed div. Also started using a code editor that highlights matching brackets in different colors so now I can see right away if something is off. It saves so much time compared to scrolling line by line for hours. The footer in the middle of the page thing is classic broken box model behavior though.
6
the_kai
the_kai10d ago
Wait'll you hit 500 lines and a single missing semicolon in the middle of a media query breaks everything on mobile but not desktop... spent a whole weekend chasing that one down. The validator tip is solid though, I just use the browser dev tools more now and look for the red error in the console when something glitches out. Still makes me laugh how one little character can turn your entire layout into a hot mess, like coding is just stackin' dominoes until you sneeze.
2