Opposition to the Civil Rights Acts and the adoption of the Republican Southern Strategy are what drove black voters away from the GOP. Prior to the enactment of the Civil Rights Acts and the subsequent adoption of the Republican Southern Strategy, the black vote was split between the parties. In 1956, Eisenhower got 39 percent of the black vote. In 1960, Richard Nixon received 32 percent of the black vote. In 1964, LBJ got 94% of the black vote.
The huge swing between 1960 and 1964 was because of the strong opposition to the the Civil Rights Acts by Barry Goldwater, William F. Buckley Jr. and other conservative republicans and because Martin Luther King Jr. changed from being officially neutral in the 1960 election to opposing Goldwater in 1964.
. . . .
King's neutrality changed dramatically by 1964. King declared that though Barry Goldwater was not racist, his positions gave aid and comfort to racists:
I had no alternative but to urge every Negro and white person of goodwill to vote against Mr. Goldwater and to withdraw support from any Republican candidate that did not publicly disassociate himself from Senator Goldwater and his philosophy.
. . . .
http://www.nationalreview.com/george/george071200.html
In fairness to republicans, the Civil Rights Acts were opposed by most Southern democrats (of which there were many) and by Southern republicans (of which there were few). However, many of the then prominent racist democrats are now known as republicans; Strom Thurmond, Jesse Helms, Trent Lott, Phil Gramm, and many other racist "dixiecrats" switched parties.
Shortly after the passage of the Civil Rights Acts, the republican party decided to alienate the vast majority of black Americans in favor of appealing to racist and bigoted Americans. That decision was the basis of the Republican Southern Strategy. In 1970, one of Richard Nixon's political strategists, Kevin Phillips, talked about the Republican Southern Strategy in the following terms:
From now on, the Republicans are never going to get more than 10 to 20 percent of the Negro vote and they don't need any more than that... but Republicans would be shortsighted if they weakened enforcement of the Voting Rights Act. The more Negroes who register as Democrats in the South, the sooner the Negrophobe whites will quit the Democrats and become Republicans. That's where the votes are. Without that prodding from the blacks, the whites will backslide into their old comfortable arrangement with the local Democrats.
http://en.wikipedia.org/wiki/Southern_strategy
And one of Ronald Reagan's political consultants and later head of the RNC, Lee Atwater, described the Republican Southern Strategy as follows:
You start out in 1954 by saying, "Nigger, nigger, nigger." By 1968 you can't say "nigger"—that hurts you. Backfires. So you say stuff like forced busing, states' rights and all that stuff. You're getting so abstract now you're talking about cutting taxes, and all these things you're talking about are totally economic things and a byproduct of them is blacks get hurt worse than whites.
http://en.wikipedia.org/wiki/Southern_strategy
Republicans have no one but themselves to blame for black Americans voting in overwhelming percentages for democratic candidates. That was one of the intentional aims of the Republican Southern Strategy.