Home affordability dropped a little in the second quarter according to a new study by the Wells Fargo and the National Association of Home Builders.

Increasing home prices could not be offset by a quarter-point drop in mortgage interest rates, which caused the association’s Housing Opportunity Index to decline two points.

"While builder confidence remains solid and sales and starts are running at a healthy clip above last year's levels, housing continues to confront persistent headwinds," said NAHB Chairman Granger MacDonald, a home builder and developer from Kerrville, Texas. "Rising material prices, particularly lumber, along with chronic shortages of buildable lots and skilled labor are putting upward pressure on home prices and impeding a more robust housing recovery."

According to the index, 59.4 percent of new and existing homes sold in the quarter were considered affordable to families earning the $68,000 U.S. median annual income. The national median home price rose to $256,000.

"The job market continues to gain steam and this is boosting housing demand," said NAHB chief economist Robert Dietz. "Meanwhile, growing incomes and attractive mortgage rates are helping to keep housing affordable by partially offsetting ongoing home price appreciation. Home prices will continue to rise as inventory remains tight. NAHB expects the housing market will continue to make gradual gains in 2017."