Fences often cause disputes between neighbors, and California has quite a number of laws pertaining to fences and disputes over them. These laws seek to find a fair balance that allows both parties to enjoy their own properties without infringement by the others.
There is one situation where a fence could become almost like a weapon. This type of fence is a spite fence.
According to California Legislative Information, a spite fence is any fence put up by one person to annoy another person. Typically, the people are neighbors. The erection of the fence is a malicious act that only serves the purpose of making the other party upset and impacting his or her enjoyment of his or her own home in a negative way.
The spite fence law does state that the fence must be over 10 feet high. It distinguishes this type of fence as a nuisance. It must do something to inhibit the other party from using his or her property in a comfortable or enjoyable way.
If your neighbor has a history of complaining about noise coming from your backyard pool and he suddenly builds a fence that is so tall that it blocks the sun to your pool, this could be a spite fence. By blocking the sun, your neighbor knows you will not use your pool as much. He built it to infringe on your right to enjoy your pool. His intent was malicious, and it does stop you from comfortably enjoying your property.
You would have every right under the law to declare this fence a nuisance and seek remedies through the court.