21. If the length of the upper base of a trapezoid is $l$, and the length of the line segment connecting the midpoints of the two non-parallel sides is $m$, then the length of the line segment connecting the midpoints of the two diagonals is ( ).
(A) $m-2 l$
(B) $\frac{m}{2}-l$
(C) $2 m-l$
(D) $m-l$
21. D.

Let the lower base of the trapezoid be $a$, and the length of the required line segment be $b$. Then $\frac{a+l}{2}=m, \frac{a-l}{2}=b$.
Solving for $b$ gives $b=m-l$.