It was a rough holiday season for retailers.

Despite economic conditions that seemed perfect for a retail windfall -- low gas prices and unemployment under 5% -- many of the big names such as Wal-Mart (WMT 0.46%)Macy'sKohl's, and Best Buy posted underwhelming quarterly reports, with declining or flat same-store sales and falling profits. All of these names have announced store closures recently, and the group is struggling with the threat of e-commerce and headwinds weighing down department stores and other traditional retail formats.

One big box store managed to buck the trend in traditional retail, however. Target(TGT 1.03%) shares are up 6% since the company released earnings -- it saw comps increase 1.9% with the help of a 34% jump in online sales. The cheap-chic retailer missed earnings estimates by $0.02 due to heavy promotions on online sales, but investors were encouraged by growth in key areas nonetheless. Let's look at a few of the things that Target did right.

1. Leading with your strengths
In an effort to distinguish Target from the competition, new CEO Brian Cornell has singled out specific departments as signature categories -- kids, style, baby, and wellness. Cornell made the decision as he believed Target had drifted too much into Wal-Mart's territory, focusing on low-margin groceries instead of the cheap-chic styles and products that have given Target its distinct brand.

The strategy seems to be working, as comparable sales grew three times faster in those categories than the company average, or nearly 6%. Meanwhile, comps in home goods were up 4%, its best growth in more than a decade. Target's partnerships with designers such as Lilly Pulitzer, which sold out almost immediately last April, have proved to be an important differentiator for the company as well, and they further enhance the company's affordable upscale brand, separating it from Wal-Mart. 

2. Committing to e-commerce
After years of letting Amazon.com build a virtually unchallenged e-commerce empire, brick-and-mortar retailers have finally awoken to the need to compete online. All of the retail giants have stepped up efforts to grab online share, but Target is taking it one step further. The retailer lowered its order minimum for free shipping last year to $25, the lowest in the industry. Over the holiday season, Target also rolled out a number of other promotions to encourage online spending like 15% across-the-board discounts on Cyber Monday and free shipping during the holiday season. As a result, online sales jumped 34%, beating even Amazon, and the digital channel made up 5% of sales, or more than $1 billion. The move did take a bite out of profitability, however, lowering Target's gross margin from 28.4% to 27.9%, as online customers are less profitable. Still, the company invested $1 billion into improving its e-commerce operations, and the sales growth is a promising sign.

3. Targeting cities
While all of its retail rivals have announced store closings recently, Target is doubling down on its urban strategy with 11 planned openings of small-format locations in cities this year and several more in 2017. Other retailers, such as Nordstrom, have found success with small-format stores, and Target's brand has been a much better fit with the upscale urban customer than, say, Wal-Mart. The world's largest retailer recently announced the closing of all 102 Walmart Express stores and is slowing the growth of its Neighborhood Market chain, despite signs of success. 

With its focus on cities and e-commerce, Target is following its customer base. Young Americans are fleeing the suburbs for urban areas, causing a wave of gentrification across forgotten cities and neighborhoods. Unlike department store chains such as Macy's that are anchored to massive properties, Target can be more nimble, and its brand better is better suited to such small-format locations.

While Target may have been the winner among brick-and-mortar retailers this past holiday season, Amazon still grabbed 51% of applicable growth in retail over the holidays, according to some measurements. With over $100 billion in annual sales and growth above 20%, it's clear that Amazon, and e-commerce with it, is going to continue to remake the retail industry. Companies that understand that, like Target, will have a much better chance of thriving.