Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
February 17, 2016 02:03 pm GMT

Using calc() to fake a media query

A bonafide CSS trick by Rmi Parmentier. It's used in the context of emails here, but it's a clever trick in it's own right.

This is the trick:

/* When parent is 500px wide... */
.block {
min-width: 50%; /* 250px WINNER */
max-width: 100%; /* 500px */
width: calc(480px - 100%) * 480); /* -9600px */
}

/* When parent is 400px wide... */
.block {
min-width: 50%; /* 200px */
max-width: 100%; /* 400px WINNER */
width: calc(480px


Using calc() to fake a media query is a post from CSS-Tricks


Original Link: https://medium.freecodecamp.com/the-fab-four-technique-to-create-responsive-emails-without-media-queries-baf11fdfa848#.qn28y65bx

Share this article:    Share on Facebook
View Full Article

CSS Tricks

A Web Design Community curated by Chris Coyier

More About this Source Visit CSS Tricks