Detect a mobile device and add a separate style sheet

综合技术 2017-11-28 阅读原文

I’m having some problems with added separate stylesheets when detecting mobile and tablet devices. I currently have the following at the top of my header file to detect mobile devices.

However when I call the following within my head tags the stylesheet doesn’t get called for some reason.

<link rel="stylesheet" type="text/css" href="/stylesheets/mobile.css">

I’ve tested the first php code I wrote on this post by adding in echo 'This is a mobile browser';
and this displays fine so the first bit is working. Just no idea why the stylesheet is not being called.

Here’s an example of some css styles in mobile.css

clear:both !important;
display:block !important;
width:100% !important;
float:none !important;
margin:0 !important;
padding:0 !important;
position: static !important;


Hello, buddy!

责编内容by:Hello, buddy!阅读原文】。感谢您的支持!


没有基础能不能学好淘宝美工?怎么学好呢?... 没有基础能不能学好淘宝美工?怎么学好呢? 很多人在转行做淘宝美工的时候都会问,没有基础能不能学淘宝美工?没基础会不会难学? 要怎么学呢?很多人在学...
这不是Axure教程!(七)强大的中继器__1... 中继器,从物理层面是一个实体工具,可以作为局域网所有节点的中心,放大信号,增强远距离的通信,把不同传输介质的网络连在一起。 而在Axure软件中,中继...
html页面直接导出word pdf 直接上代码 html ///这里放想要导出的html 元素 function ExportWord() {...
第一个 HTML5Plus 移动应用 什么是 HTML5Plus 移动应用 HTML5 Plus移动App,简称5+App,是一种基于HTML、JS、CSS编写的运行于手机端的App,这种App...
Introducing the updated HTML comparison report in ... Whether you need to deploy changes, or simply view the differences between two S...