LinHES Forums http://forum.linhes.org/ |
|
How to make the LinHES default page iPhone-compatible http://forum.linhes.org/viewtopic.php?f=6&t=20268 |
Page 1 of 1 |
Author: | nickca [ Sun Aug 30, 2009 6:50 pm ] |
Post subject: | How to make the LinHES default page iPhone-compatible |
It's a pretty simple change to make, and makes the default page much more readable on any device with a width less than 480px, and the iPhone in particular (the "viewport" meta tag only works on iPhone Safari). Just edit the file index.html, and after this line (near the top): Code: <title>LinHES R6</title><link href="KnoppMyth.css" rel="stylesheet" type="text/css"></head> add these lines: Code: <link media="only screen and (max-device-width: 480px)" href="iphone.css" type="text/css" rel="stylesheet" /> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" /> Now create a file named iphone.css in the same directory (/data/srv/httpd/htdocs), with this in it: Code: body {
background: #fff; font-family: Helvetica, Arial, sans-serif; margin: 0; padding: 0; width: 100%; } p { font-size: 1em; } p.headerimage { font-size: 2em; } img { width: 100%; height: auto; } table { width: 320px; } Now try it on your phone, and you should see that it's readable without needing to scale it down to a tiny size. All this is doing is telling users' web browsers that if their max browser width is less then 480px, then load the "iphone.css" stylesheet in addition to any other stylesheets that have been loaded. There's also the "viewport" meta tag, which tells the iPhone's Safari browser not to scale the page at all (default and max scaling = 1.0). You could redefine any elements you want in iphone.css, this one is minimal. |
Author: | Too Many Secrets [ Sun Aug 30, 2009 7:45 pm ] |
Post subject: | |
Hey this is GREAT! Thanks. Can anything be done to make the mythweb interface more iPhone friendly? Any thoughts on streaming LiveTV to iPhone? (personally a killer app) |
Page 1 of 1 | All times are UTC - 6 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |