Samia-
I'm not sure at what depth you want this answered, so I'll guess a sort of mid-level.
The magnetic B field near a current-carrying wire circles around
the wire. The B fields from many wires just add together, but generally
you have to be carefully to add them like vectors, remembering which
way they point.
Say that our solenoid loops around some vertical axis. Look at some
point in the middle of the solenoid. The B fields which loop around the
wires in all horizontal directions from the middle all point the same
way in the middle of the solenoid- either up or down. If you look at
the fields from other parts of the wires, above or below the point
we're interested in, they also have inward or outward components.
However, when you add up the fields from all the wires around the
solenoid, those in-out components all cancel, just leaving the upward
or downward part.
You might find it easiest to picture this by making a few rings of
wire to represent the solenoid. Then make some paper rings with arrows
around them. You can see that if the arrows go the same way around the
wires, the ones in the center all add up, either upwards or downwards.
Mike W.
(published on 10/22/2007)