Why is the sky blue?
Light is a kind of energy that can travel through space. Light from the sun or a light bulb looks white, but it is really a mixture of many colors. The colors in white light are red, orange, yellow, green, blue and violet. You can see these colors when you look at a rainbow in the sky.
The sky is filled with air. Air is a mixture of tiny gas molecules and small bits of solid stuff, like dust.
As sunlight goes through the air, it bumps into the molecules and dust. When light hits a gas molecule, it may bounce off in a different direction. Some colors of light, like red and orange, pass straight through the air. But most of the blue light bounces off in all directions. In this way, the blue light gets scattered all around the sky.
When you look up, some of this blue light reaches your eyes from all over the sky. Since you see blue light from everywhere overhead, the sky looks blue.
In space, there is no air. Because there is nothing for the light to bounce off, it just goes straight. None of the light gets scattered, and the "sky" looks dark and black.