Detective fiction is a kind of crime fiction that focuses on the heroic detective as much as the crime itself. Though the genre is often said to have originated with writers like Edgar Allen Poe and Steen Steensen Blicher, detective stories have been around since ancient times. Since the genre’s official recognition in the 1800s, detective fiction has evolved in different ways, including adjustments to the personalities of the heroes and changes to the tone. There are also many variations on detective stories, including some that are almost like adventure stories, and others that are more like horror.
In the earliest detective fiction, the hero was typically a highly sophisticated individual, and the stories almost always focused on the intelligence of the detective, his cleverness, and his ability to outwit the criminal. A generally well-known example of this kind of detective character is Sherlock Holmes. There were many other detective characters modeled to some degree or another after Sherlock Holmes, and more than a few were popular enough to generate a series of novels.
Another common type of detective character is the hard-bitten private-eye. These characters were particularly popular in the pulp detective fiction stories from the 1920s. Usually, they were slightly less refined than detectives in the "Sherlock Holmes" tradition, and they often had to rely on guts as much as brains in order to solve the crime. Phillip Marlowe is a classic example of this type of character.
Over time, detective fiction evolved, and the kinds of characters used became more diverse. Popular detective novelists also brought new elements to their stories to match with the changing times. For example, there are popular detective characters who are computer hackers, and others who rely on advanced forensic technology. Some detective fiction even focuses specifically on characters who are forensic technicians.
There is also a kind of detective fiction that can be a little bit darker. Sometimes these stories may drift slightly beyond the normal realm of the detective genre, and some may even step into the world of horror fiction. The main thing that separates these stories is often the macabre nature of the crimes committed, and sometimes the villains might be so sinister that they almost take on a supernatural quality. In fact, in some cases, the villain actually is supernatural, but it could be argued that these stories are too far afield to fit comfortably into the detective fiction category.