I do have some experience with this, being a web designer, and can offer my opinion.
Any code that you personally write, or obtain permission to use from another individual who wrote code, is automatically covered under copyright and assigned to you, just like writing a book, a letter, or a post online.
Simply saving such material to your hard drive is NOT a violation of copyright law, since your web browser automatically does that before displaying the result of the code to you, and is generally considered fair use. It is nearlly technically impossible for this NOT to happen, and thus is considered acceptable.
Doing something with it is another matter and opens up a whole can of worms. If you were to just re-post the code, unaltered, then quite possibly you are violating another individual's copyright. To have that code also render output to the web browser could violate even more rights.
Of course a lot of that actually depends on what the code IS. It would be a nearly impossible case to argue that using common HTML tags in a very common way constitutes a copyright infringement. However if that code is used to output in such a way that, say, it closely or exactly resembles the look of another site that is unique and identifiable (say, eBay, Amazon, Slashdot) then you could be stepping into problems there. Another example that was a big problem a few years ago would be examining the source code that makes up the way a web site's navigation menu operates. Looking at the code and using it to create your own code isn't infringing, however ripping that code and posting it verbatim would be, if the result is arguably unique.