This rectangle is divided into 8 parts, so the denominator of the fraction is 8.
Three of the parts are green.  If we want to express how much of the rectangle is green, the 3 is the numerator and we say that 3/8 of the rectangle is green.