Skip to content
Home Blog Web Development Handy CSS Tips for Responsive Design

Handy CSS Tips for Responsive Design

  • Web Development
Blueprint Digital
Blueprint Digital

Insights from the Blueprint Digital team.

Responsive design seems to be everywhere these days. I previously shared some responsive design tricks as well as some other useful tips on responsive design. Today, I am going to offer some more CSS tips that will be especially handy for responsive web development.

CSS Media Queries for Retina Displays

Retina displays have a higher pixel ratio than regular screens. Therefore, images might not look too great on a mobile device. To deal with this problem, there are media queries for retina displays.

One of the joys of being a front-end web developer is dealing with browser compatibility issues. To deal with the different browsers available for the mobile platform, there are vendor prefixes for the retina display media query:

-webkit-min-device-pixel-ratio
min--moz-device-pixel-ratio
-o-min-device-pixel-ratio

In the actual CSS, the media queries will probably look something like this:

@media only screen and (-moz-min-device-pixel-ratio: 1.5),
only screen and (-o-min-device-pixel-ratio: 3/2),
only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5),
only screen and (min-resolution: 144dpi) {
    .foo {
         background-image:url(images/bar.png);
     }
}

CSS Gradients

To provide a faster loading time on a mobile device and to avoid issues with different displays, it is probably better to use CSS3 gradients instead of making images out of gradients in Photoshop. However, the thing about CSS3 gradients is that the code can easily become too long if it is repeated. Therefore, it is useful to make one CSS class for a repeatedly-used gradient style. For example, you could have something like this:

.pink {
     background: #fcecfc;
     background: -moz-linear-gradient(top,  #fcecfc 0%, #ff7cd8 100%);
     background: -webkit-gradient(linear, left top, left bottom,
color-stop(0%,#fcecfc), color-stop(100%,#ff7cd8));
     background: -webkit-linear-gradient(top,  #fcecfc 0%,#ff7cd8 100%);
     background: -o-linear-gradient(top,  #fcecfc 0%,#ff7cd8 100%);
     background: -ms-linear-gradient(top,  #fcecfc 0%,#ff7cd8 100%);
     background: linear-gradient(to bottom,  #fcecfc 0%,#ff7cd8 100%);
}

The CSS code above will generate something like this below, and you can use the .pink class everywhere you want the pink gradient to appear:

Using one class to apply to similar elements doesn’t only have to apply to gradients. This kind of solution seems simple, but when there are deadlines to meet, sometimes it can be hard to keep code clean and there may be duplicate code. Remembering that classes can be reused will be really handy.

Conclusion

I hope this article was helpful! What other CSS tips do you find useful? Leave a comment below.

Ready to Dominate Online and Grow Your Business?

Schedule time to connect with Blueprint about your online goals, or request a free review of marketing campaigns.

Related Posts

Digital Marketing for Orthopedic Surgeons

Digital Marketing for Orthopedic Surgeons

Orthopedic practices used to fill their schedules through physician referrals. Patients now find and choose their own surgeon online, often before a referral enters the picture. Someone with knee pain or a torn rotator cuff will research the problem and compare practices before calling any of them. Digital marketing for orthopedic surgeons reaches those patients[...]
How to Find AI Search Ranking Opportunities Your Competitors Are Winning (With Semrush)

How to Find AI Search Ranking Opportunities Your Competitors Are Winning (With Semrush)

If you’ve spent any time watching how people search over the past year, you’ve probably noticed a shift. More users are asking ChatGPT, Google’s AI Overviews, Perplexity, and other AI-powered search tools for recommendations instead of clicking through a page of blue links. While traditional SEO remains an important part of a digital marketing strategy,[...]
Personal Injury Marketing: A 2026 Playbook

Personal Injury Marketing: A 2026 Playbook

Injury care is one of the hardest categories in healthcare to market. Patients decide within days of getting hurt, and the keywords that reach them are among the most expensive in search. A practice can rank at the top of Google and still lose the patient to a competitor who answered the phone first. Personal[...]
Previous
Next

Partner with BLUEPRINT to reach your online goals, grow your business and reshape your story.

Get in touch with BLUEPRINT

Reach out to request a discovery call, a free campaign review, or for all other inquiries.

Subscribe to our newsletter