/    Sign up×
Community /Pin to ProfileBookmark

Media Query Question!

I’m trying to get a handle on how media queries are coded so they work properly when the browsers that do not support them and also on browsers that do. Let me give a small example:

I design a page with a banner graphic that is 1200 pixels wide. Under the banner are 3 columns, navigation, content and advertisements. I also design a variable width banner for my page. If the browser screen is wide enough, I want to display the nice graphic and also the ads, if not, use the variable width banner and drop the ads.

I place my banners in two different DIV sections and create two style sheets, each one uses the display: none; directive to hide one or the other banner.

I want to use the narrower CSS as my default.

As I understand media queries, I have to put the alternate CSS file inside an if this is ie8 block and say use it for widths greater than 1200. The question is, how do I override the fact that the other stylesheet which is to be used for all browsers, even those that don’t understand media queries, has hidden the wide banner graphic?

to post a comment
CSS

0Be the first to comment 😎

×

Success!

Help @PapaGeek spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...