Someone posted a query regarding web development (HTML, CSS stuff) and the question looked like it needed a bit more furnishing. But, anyway I went ahead to answer it as it seemed okay. I put like about half hour or so to get the answer code for the required result ready and posted it away. About some minutes later, I saw that the OP had added a few restrictions to the question about what can/cannot be used. That made my answer unusable for the OP's use-case and maybe she/he down-voted the answer with comment to refer the answer restrictions. I did not know how to fix it with the added restrictions so I deleted the answer since it was not acceptable (and also to avoid more down-votes).
Later, I came back to SO to see that someone had down-voted many of my well-received posts (maybe the same person went to my profile to see all the things on SO I posted) for no reason/explanation. Was anything wrong with deleting the answer in particular? What is the preferred thing to do on SO for such future-irrelevant posts?