Keyword density is just one factor. Where the keywords are found within the page is also important. Keywords found in the following page elements are given more prominence:
- The page title (the <title> tag)
- The page description and keyword list (the <meta> tag)
- The anchor text of a link (the <a> tag)
- Headings (the <h1>, <h2>, etc., tags)
- Bold and italicized text (the <b> and <i> tags)
- Lists (the <ul>, <ol>, and <dl> tags)
So it's a bad idea to use CSS styles to bold or italicize text or to create custom headings: The crawler analyzing the page doesn't look at the CSS. You can still use CSS, but just be sure to use <h1> and similar tags for headings and do your bolding and italicizing with the <b> and <i> tags.
The actual location within the HTML source code for the page is also important: Keywords closer to the top are deemed more important than those near the bottom. Note that this does not necessarily correspond to the location at which the content is displayed—use the View Source option of your browser and look closely at the page to see which text the crawler sees first.