An electronic device, wherein the electronic device comprises: a housing; a first electronic element; a second electronic element; and a buffer component, wherein the buffer component is connected to the housing, the first electronic element is located on a side that is of the buffer component and that is away from the housing, and the second electronic element is located on a side that is of the housing and that is away from the buffer component, wherein a recess is disposed in the buffer component, and at least a part of a front projection of the second electronic element in a thickness direction of the electronic device falls within a front projection of the recess in the thickness direction of the electronic device; wherein the recess comprises a first recess, the first recess is located on a side that is of the buffer component and that faces the second electronic element, and the recess is recessed away from the second electronic element; wherein the housing is a middle frame of the electronic device; the buffer component is located between the first electronic element and the housing; the housing is located between the buffer component and the second electronic element; the recess is a groove structure, wherein a bottom of the groove is not penetrated; and in the thickness direction of the electronic device, a depth of the recess is m, and a thickness of the buffer component is n, wherein 0 < m < n, wherein the recess further comprises a second recess, and the second recess is located on a side that is of the buffer component and that is away from the second electronic element and faces the first electronic element, wherein the recess is recessed away from the first electronic element. a housing; a first electronic element; a second electronic element; and a buffer component, wherein the buffer component is connected to the housing, the first electronic element is located on a side that is of the buffer component and that is away from the housing, and the second electronic element is located on a side that is of the housing and that is away from the buffer component, wherein a recess is disposed in the buffer component, and at least a part of a front projection of the second electronic element in a thickness direction of the electronic device falls within a front projection of the recess in the thickness direction of the electronic device; wherein the recess comprises a first recess, the first recess is located on a side that is of the buffer component and that faces the second electronic element, and the recess is recessed away from the second electronic element; wherein the housing is a middle frame of the electronic device; the buffer component is located between the first electronic element and the housing; the housing is located between the buffer component and the second electronic element; the recess is a groove structure, wherein a bottom of the groove is not penetrated; and in the thickness direction of the electronic device, a depth of the recess is m, and a thickness of the buffer component is n, wherein 0 < m < n, wherein the recess further comprises a second recess, and the second recess is located on a side that is of the buffer component and that is away from the second electronic element and faces the first electronic element, wherein the recess is recessed away from the first electronic element.