Has a Candidate Ever Lost Florida and Ohio but Won the Election?

In his latest tweet challenging the outcome of the election, President Donald Trump claimed that no presidential candidate has won both Ohio and Florida but still lost the election, as he did:
Trump’s loss despite wins in Ohio and Florida is not without precedent, however: In 1960 John F. Kennedy lost both states to Richard Nixon but won the Electoral College 303-219.