An electric bed with a sliding block linkage has a head board, an inner frame, an outer frame, and a head supporting part. Two ends of the head supporting part are in rotatable connection with the head board and the outer frame. The inner frame is in sliding connection with the outer frame. The head board is in rotatable connection with the inner frame. A sliding block linkage has a driving device used for driving the inner frame to move relative to the outer frame. Relative sliding in a horizontal direction controls a horizontal movement distance of the head board. Optionally, the inner frame is positioned on the outer frame and movably connected with it by a sliding chute. The inner frame is driven by a motor to horizontally move relative to the outer frame.