It's your floatium, so yes, this will all work just fine. But... to make your story interesting
Your city doesn't exist in a vacuum. It exists in an atmosphere. Whenever the wind blows, your city will move. Whenever the pressure changes beneath or above the city, your city will move. There are a number of reasons why your city will move.
You could, theoretically, assume a "natural" valley where a great chunk of naturally magnetic stuff broke away and found a stable location. People hiking through the mountains, wondering why it was so honking cold, saw the chunk of stuff hanging in the sky and thought to themselves, "we have grappling hooks, picks, and blow torches... let's build a city!" The chunk is so large that, after flattening a city-sized space on top, there is still plenty of magnetic stuff left to keep the chunk floating.
Your city is happily thriving until the wind blows. You could make the valley so small, deep, and narrow that the magnets repel off of every side, but that's boring. This sucker sails! The problem is that everyone lives in fear of the day when the wind blows so hard that the chunk-o-stuff won't repel and will, instead, touch the side of the valley (potentially discharging a fair amount of static electricity). So they thought to themselves, "we have temples and churches, let's pray to a god!" So now people go on a pilgrimage to find ferrous metal through the frozen wastes of the floatium mountains to be thrown off the sides of the city. It's considered an accepted offering if it swings back in and sticks to the sides.1
But what really has people confused is when the city goes up and down. Sometimes it's because it's blazing hot in the summer, causing a high pressure zone to build beneath the city. Sometimes it's really cold in the winter (those mountains are at zero, after all...) causing a low pressure zone under the city. The normal bobbing doesn't generally bother many people, but it has led to protests for improved medical care and free Dramamine which brought about inflation followed by a general recession that led to some notoriety about people throwing themselves off the side of the city because the stock market crashed.2
But what really upset people was the Great Slide of '57. Everybody was sleeping peacefully when suddenly the entire city shifted up and north-east about 20 miles. Scared the snot out of everybody. Birds weren't seen for a week. Goats refused to give milk. The weekly food delivery... didn't... there were riots all over the city and a sudden surge in people believing in Whoosh!3 What nobody realized (because they're not connected to the ground) is that an 8.7 magnitude earthquake shifted the Floatium, forcing the city to restabilize.4
One more item: the Chunk-o-Stuff I mentioned above would have to have a very high percentage of naturally occurring magnetic stuff to hold itself and a city aloft. It would be the worst ground to farm in on the planet. There would be no significant water other than the barrels filled while melting the water from snowstorms. The ground would also be constantly frozen. Feeding your population would be very, very difficult in the proposed scenario. They would depend heavily on imports.
1 Of course, people being who they are, there's also an underground cult seeking to bring about the apocalyptic end of the world by inflating goat bladders to invoke the blessings of Whoosh! god of the north wind.
2 Only one person actually did this, but people being who they are, everybody now knows somebody who has it on good authority that the person who told them about their cousin's friend's employer jumping off the side of the city has led to the popular belief that thousands did it.
3 It's fairly important that people read footnotes....
4 Joorn and Clameda Oooomph reported to the local newspaper that their baby was born during the Great Slide. They called her Weee! OK, it's not always important to read footnotes....