An exemplary electronic device (30) includes a main body (40) and two support legs (43). The main body has two sloping slide portions (415) formed at two adjacent corners thereof. A depth of each sloping slide portion increases from one end to the other end. Each support leg are movably connected to one corresponding sloping slide portion, such that a height of the support leg relative to main body is capable of being changed when the support leg moves relative to the main body.