Both only act over a finite range within the nucleus of an atom.
Of the four natural forces, strong nuclear, weak nuclear, electromagnetic and gravity, only two have a finite range. The strong force has a range of about the width of an atomic nucleus, and is responsible for binding protons and neutrons together. The range of the weak force is much smaller, even less than the width of a proton.
Gravity and electromagnetism, on the other hand, follow inverse square laws, where the strength of the force decreases over larger and larger distances, but never really falls to zero.
##F_g = G(m_1m_2)/r^2##, ##F_e = k(q_1q_2)/r^2##
Furthermore, like electromagnetic force, the nuclear forces are governed by gauge bosons. According to the standard model, the leading theory on particle physics, the weak force is carried by an exchange of weak bosons between nuclear particles, and the strong force is carried by an exchange of gluons between nuclear particles.