You found the volume of a box by counting layers of unit cubes: $V = \ell wh$. When the edges are fractions, the cubes do not fit exactly, but smaller cubes do.
Key idea
$V = \ell \times w \times h$ works for fraction edge lengths too: a box $2\frac{1}{2}$ by 1 by $1\frac{1}{2}$ has volume $\frac{5}{2} \times 1 \times \frac{3}{2} = \frac{15}{4} = 3\frac{3}{4}$ cubic units.
Why it works
Fill the box with cubes whose edges are $\frac{1}{2}$ unit. Eight of them make one unit cube (2 by 2 by 2), so each is $\frac{1}{8}$ of a cubic unit. Along the edges fit $5$, $2$ and $3$ small cubes, so $5 \times 2 \times 3 = 30$ small cubes fill the box: $30 \times \frac{1}{8} = \frac{30}{8} = 3\frac{3}{4}$. Multiplying the edges, using fraction multiplication, gives the same number.
Worked example: Multiply the edges
Find the volume of a box $2\frac{1}{2}$ ft by 1 ft by $1\frac{1}{2}$ ft.
- Write mixed numbers as fractions: $\frac{5}{2}$, $1$, $\frac{3}{2}$.
- $\frac{5}{2} \times 1 \times \frac{3}{2} = \frac{15}{4}$.
- $\frac{15}{4} = 3\frac{3}{4}$.
Answer: $3\frac{3}{4}$ cubic feet
Worked example: Count small cubes
How many cubes with $\frac{1}{2}$-inch edges fill a box 3 in by 2 in by $1\frac{1}{2}$ in?
- Along each edge: $3 \times 2 = 6$, $2 \times 2 = 4$, $1\frac{1}{2} \times 2 = 3$.
- $6 \times 4 \times 3 = 72$ small cubes.
- Check: $72 \times \frac{1}{8} = 9$, and $3 \times 2 \times 1\frac{1}{2} = 9$ cubic inches.
Answer: 72 cubes
Worked example: A cube
Find the volume of a cube with edges $\frac{3}{2}$ m.
- $\frac{3}{2} \times \frac{3}{2} \times \frac{3}{2} = \frac{27}{8}$.
Answer: $\frac{27}{8} = 3\frac{3}{8}$ cubic meters
Common mistake
Multiplying mixed numbers piece by piece: $2\frac{1}{2} \times 1\frac{1}{2}$ is not $2 \times 1$ plus $\frac{1}{2} \times \frac{1}{2}$. Quick check: change mixed numbers to fractions first, and estimate. $2\frac{1}{2} \times 1\frac{1}{2}$ is between $2 \times 1 = 2$ and $3 \times 2 = 6$; the true value is $3\frac{3}{4}$.