Situation: several developers working remotely on different section/modules of a SPA.
As a result they may accidentally introduce HTML elements with the same id. W
If your code(problem) really big, and you can't refactor it, you can try validate your css/html for find repeat id's before each commit. But it's possible answer for very bad situations.
Good solution - using tools like bem (http://bem.info/)