The thing about HTML and CSS is that they work together. dresden_phoenix summed it up very nicely...
CSS and HTML not only depend on one another, they also depend on their own relatives, too. It takes a bit of experience before one learns how to copy bits and pieces from other code and use them in one's own.
For example, if you copy the full page examples presented above by dresden_phoenix or me, and paste them on a stand-alone page, they will all work. Each example is a stand-alone unit.
As your knowledge grows, you will learn how to selects features from one page and apply them to your own. In the beginning, before dismissing our examples as unworkable, be sure to give them a look on their own pages to see what we are demonstrating.
Everything exists in the context of its surroundings.
If you can post a link to your page, we will be happy to offer some guidance. Or, if you can post your HTML and CSS in a message, we can work with that, too. In your message, type
then paste your code here
That will put it in a box with scroll bars (like ours above) and preserve formatting.
Without being able to see your code, everything we can offer at this stage is a "guess".
Best of luck!