Tantrums are all about getting attention or getting what they want, so don't ever, ever give in to a tantrum. If one of my kids pitches a fit for something and it may have been something that was a reasonable request, if they don't ask with a nice voice, w/out all the drama, then they absolutely don't get what they wanted. And try your hardest not to react too strongly, just keep your resposes as even as possible.
On a recent grocery trip I started to reach for a regular cart and my daughter screamed and cried that she wanted a car cart. Very calmly, I told her that a car cart would have been fine had she asked in a nice voice, but since she didn't, then she has to hoof it with the regular cart. And the good news is, the next time we're at the store, ask nicely for a car cart and I'd be happy to find one. The end.
We've been through enough of these instances where she knows that further fit pitching is futile, so she doesn't even bother, but had the fit continued, there would have been further consequences. Like, you can walk with me nicely, or you can take a timeout right here in the store, or your favorite stuffed dolphin is going in my purse, etc.
And I agree with another post here...give her the choice to make a good decision. If it is in her control to stay out of a time out, and she learns from your consistency that if she doesn't choose well a time out is imminent, then she'll start opting for the better choice, even if it isn't her first choice.
Good luck!