Housing affordability dropped slightly in the second quarter, the National Association of Home Builders said.

The association said the average price for a home increased from $223,000 in the first quarter to $240,000 in the second quarter of the year. The jump was too big to be offset by a decline in average mortgage interest rates from 4.05 percent to 3.88 percent.

The NHAB said 62 percent of homes sold between April and June were within reach of families earning $65,700 — the U.S. median income. Sixty-five percent of homes were considered affordable in the first quarter of 2016.

The association’s Housing Opportunity Index, which it compiles with the help of Wells Fargo, shows that homes remain affordable, said NAHB chief economist Robert Dietz.

"Though we have seen a modest drop in affordability in the second quarter, the HOI is still fairly high by historical standards," Dietz said. "Rising employment, favorable mortgage rates and increasing household formations will keep the housing market on a gradual, upward path during the rest of the year."