body { padding: 5%; display: flex; justify-content: center; } .device { border: 1px solid #ccc; padding: 3%; margin: 3%; display: flex; flex-direction: column; align-items: center; } .sub_devices { display: flex; } .sub_device { border: 1px solid #ccc; padding: 1em; margin: 1em; display: flex; flex-direction: column; align-items: center; } .outlet_image { width: 5em; height: 5em; }