A housing comprising: a housing main body that is formed into a frame shape having an opening part, and that has an accommodation space accommodating electronic components therein; and a lid body that is stacked upward on the housing main body in upper and lower directions, and that seals the opening part, wherein the housing main body has a housing outer circumferential wall, and a housing inner circumferential wall that is positioned inside of the housing outer circumferential wall, the lid body has a top board having a plate shape, a lid body outer circumferential wall that projects from a circumferential part of the top board toward the housing main body in the upper and lower directions, a lid body inner circumferential wall that is positioned inside of the lid body outer circumferential wall, and that surrounds, with the lid body outer circumferential wall, the housing outer circumferential wall that is inserted, and ribs that couple the lid body outer circumferential wall and the lid body inner circumferential wall, the accommodation space includes a plurality of compartments that are positioned adjacent to the housing inner circumferential wall, the lid body outer circumferential wall, the lid body inner circumferential wall, and an upper end part of the housing outer circumferential wall form a space part that surrounds the accommodation space, a gap is formed at least either between the lid body outer circumferential wall and the housing outer circumferential wall and between the lid body inner circumferential wall and the housing outer circumferential wall, characterized in that the ribs include a sealing rib that is disposed and spaced in first orthogonal directions orthogonal to the upper and lower directions, and that seals the space part, the compartments include a first compartment (S11e) that is positioned on a downstream side of the sealing rib in a water flow direction in which, when water enters the space part, the water flows, among the first orthogonal directions, and that is provided with the electronic components capable of accepting electric power, and a second compartment (S11n) that is positioned on an upstream side of the sealing rib, and that is not provided with the electronic components capable of accepting electric power, and the sealing rib is positioned outside of the accommodation space in the second compartment (S11n) in a second orthogonal directions orthogonal to the upper and lower directions and the first orthogonal directions. a housing main body that is formed into a frame shape having an opening part, and that has an accommodation space accommodating electronic components therein; and a lid body that is stacked upward on the housing main body in upper and lower directions, and that seals the opening part, wherein the housing main body has a housing outer circumferential wall, and a housing inner circumferential wall that is positioned inside of the housing outer circumferential wall, the lid body has a top board having a plate shape, a lid body outer circumferential wall that projects from a circumferential part of the top board toward the housing main body in the upper and lower directions, a lid body inner circumferential wall that is positioned inside of the lid body outer circumferential wall, and that surrounds, with the lid body outer circumferential wall, the housing outer circumferential wall that is inserted, and ribs that couple the lid body outer circumferential wall and the lid body inner circumferential wall, the accommodation space includes a plurality of compartments that are positioned adjacent to the housing inner circumferential wall, the lid body outer circumferential wall, the lid body inner circumferential wall, and an upper end part of the housing outer circumferential wall form a space part that surrounds the accommodation space, a gap is formed at least either between the lid body outer circumferential wall and the housing outer circumferential wall and between the lid body inner circumferential wall and the housing outer circumferential wall, the ribs include a sealing rib that is disposed and spaced in first orthogonal directions orthogonal to the upper and lower directions, and that seals the space part, the compartments include a first compartment (S11e) that is positioned on a downstream side of the sealing rib in a water flow direction in which, when water enters the space part, the water flows, among the first orthogonal directions, and that is provided with the electronic components capable of accepting electric power, and a second compartment (S11n) that is positioned on an upstream side of the sealing rib, and that is not provided with the electronic components capable of accepting electric power, and the sealing rib is positioned outside of the accommodation space in the second compartment (S11n) in a second orthogonal directions orthogonal to the upper and lower directions and the first orthogonal directions.