When the Civil Rights Act was signed, it didn't change the attitudes of the racists. They were still racist the day after it was signed.
When racism was exposed, when people boycotted the racist businesses, when people marched in the streets, protested, and condemned it in the churches, and confronted the racists, over time that's when the attitudes started changing.
You cannot change attitudes just by passing a law.