CFD trade example
If you wanted to trade a stock with an asking price of $20 and buy 100 shares, this would traditionally have cost $2,000 ($20 x 100). With a CFD broker who requires 5% margin, you could open this position with just $100 ($2,000 / 100 * 5). Leverage will vary between brokers and you will need to factor the spread, commission, swap and any other fees into each trade.
Most reputable CFD brokers will offer negative balance protection, which ensures that you will not end up owing your broker more than your initial account balance. They will close out your trades once your margin is used up to prevent further losses.