Fits of temper in young children are often just a way to express intense emotion that they don't know how else to deal with.
Violence in young children is often a way of making themselves feel powerful.
If your 18 month old hitting their head on the floor FORCES you to act, then you are giving them A LOT of power for doing that. If violent outbursts SCARE you, then violent outbursts give your child AN INCREDIBLE amount of power.
You aren't going to stop the violent outbursts in your child until YOU learn to cope with them.
Here's my advice:
When the child throws a tantrum - not violent, just angry - then acknowledge them at first. You could say something like, "Wow, you are really upset about ___________. What should we do about this?" Getting your child engaged in dialogue will often end the tantrum.
If your child will not talk, starts banging their head on the floor, or gets violent, PICK THEM UP (from behind, under their arms, if you're scared), hold them tightly against your body (you may want to wrap one arm around him - under his arm, across his chest, and then pin his head to your chest to prevent him slamming his head backwards...not that it will hurt terribly if he does), and take them firmly, quickly, and quietly to Time Out.
Time Out should be three things: inescapable, quiet, and OUT OF SIGHT. A stroller or car seat that straps the child into place is a great Time Out. You don't want the child to run right back out of Time Out, or to hurt themselves (such as with head banging) or to kick at their bedroom door, so you strap them in. This also makes Time Out more calming - and less bearable - for many kids. Time Out should be in a quiet, calm environment. It should also be out of sight. Your child can't impress you with his violent outbursts if you aren't watching. He may try and engage you by screaming or yelling the first time or three, but after a while, he'll learn that Time Out is Time Out, and that will stop. A good indicator for the length of Time Out is 1 minute for every year of age.
THEN when your child starts to throw his next tantrum, the first step is to try to engage them... something like, "Wow, you're really angry about ____________. What should we do about it?" or even, "Would you like to watch a movie?" If that doesn't work, the next step is, "You have two choices: stop behaving that way or go to Time Out. Which do you prefer?" If there is no answer, you say, "Well, I guess it's Time Out, then," and carry them off.
Don't give your child the message that violence gives them power, and don't assume there's something wrong with your child.
Don't be afraid, and don't give up. Lots of kids go through similar outbursts, and it's your job as a mom to teach them that those behaviors will get them nowhere...nowhere but Time Out, anyway. :)