Suppose I have a smooth projective surface $S$ and a curve $C\subset S$. The self-intersection of $C$ is by definition the degree of the restriction to $C$ of the normal bundle of $C$ inside $S$.
By the very definition, if I deform $C$ inside $S$ then the self intersection does not change. Now, I wonder if this stays constant if I deform the surface as well, but keeping it smooth. More precisely: let us fix $S$ smooth first and deform $C$ to $C'\subset S$ and then deform $S$ to $S''$ via a smooth family. Let $C''\subset S''$ the deformation of $C'$ obtained through the deformation $S \to S''$. Does $(C\cdot C)=(C'' \cdot C'')$ always hold?