Call external JS file based on “media screen” value

You can’t do that directly using Javascript <script> tags. Media queries are used in linked CSS files or inline CSS styles. A basic example: <link rel=”stylesheet” media=”screen and (min-width: 900px)” href=”https://stackoverflow.com/questions/15823137/desktop.css”/> <link rel=”stylesheet” media=”screen and (min-width: 571px)” href=”tablet.css”/> <link rel=”stylesheet” media=”screen and (max-width: 570px)” href=”mobile.css”/> Or directly in your stylesheets: @media screen and (max-width: 599px) … Read more

IE7, IE8 support for css3 media query [duplicate]

Include this meta tag in the <head>. <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> Internet Explorer 8 or older doesn’t support media query. You can use media-queries.js or respond.js to add media query support in IE. <!–[if lt IE 9]> <script src=”http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js”></script> <![endif]–> I think this two links will help you. http://cssmatter.com/blog/ie7-and-ie8-support-for-css3-media-query/ http://webdesignerwall.com/tutorials/responsive-design-in-3-steps/comment-page-2 Update css3-mediaqueries-js is moved on … Read more

Which are the most important media queries to use in creating mobile responsive design?

I’d recommend taking after Twitter’s Bootstrap with just these four media queries: /* Landscape phones and down */ @media (max-width: 480px) { … } /* Landscape phone to portrait tablet */ @media (max-width: 767px) { … } /* Portrait tablet to landscape and desktop */ @media (min-width: 768px) and (max-width: 979px) { … } /* … Read more

What can be other ways than @media to make a website responsive suitably if I don’t mention target resolution? [closed]

Adaptive layouts (Responsive layouts) consists of the following three factors: 1. Flexible Layouts: The divs you use to create your web page layouts need to consist of relative length units. This means you shouldn’t use fixed widths in your CSS, rather use percentages. The formula to convert sizes from a design to percentages is (target/context)x100 … Read more

How can I detect Internet Explorer (IE) and Microsoft Edge using JavaScript?

Here is the latest correct way that I know of how to check for IE and Edge: if (/MSIE 10/i.test(navigator.userAgent)) { // This is internet explorer 10 window.alert(‘isIE10’); } if (/MSIE 9/i.test(navigator.userAgent) || /rv:11.0/i.test(navigator.userAgent)) { // This is internet explorer 9 or 11 window.location = ‘pages/core/ie.htm’; } if (/Edge\/\d./i.test(navigator.userAgent)){ // This is Microsoft Edge window.alert(‘Microsoft … Read more

How to create new breakpoints in bootstrap 4 using CDN?

It can’t be done entirely from CDN. To properly customize/override using SASS, you need to @import the necessary Bootstrap scss files in your custom.scss. To override the grid-breakpoints, at a minimum you need functions and variables. Then set the variables as needed, and finally @import bootstrap. Notice how default! has been removed as explained in … Read more