html5 中meta中 content=width=device-width注意
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0">
<style>
body { margin:0; font-size: 13px; font-family: sans-serif; color:#333; line-height: 1.5; background: #fff;}
div{ margin:0;}
a{-webkit-tap-highlight-color:transparent; color:inherit;}
.jesgoo-ad-container { width: 100%; height: 100%; overflow: hidden;}
.jesgoo-content { position: absolute; left: 0; top: 0; width: 100%; height: 100%; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; text-decoration: none; }
.jesgoo-icon { float: left; border: none; width: 36px; height: 36px; margin:6px 0 0 12px; border-radius: 6px; overflow: hidden;}
.jesgoo-text{ float: left; padding-left: 10px; padding-top: 6px; width: 210px; overflow: hidden;}
.jesgoo-text.text { width: 260px; }
.jesgoo-title, .jesgoo-desc { white-space: nowrap; overflow: hidden; text-overflow:ellipsis;}
.jesgoo-title { font-weight: 800;}
.jesgoo-desc { color: #666; font-size: 12px; }
.jesgoo-desc marquee{ /*text-indent: -180px;*/}
.jesgoo-btn{ position: absolute; width: 40px; line-height: 24px; text-align: center; right: 12px; top: 50%; margin-top: -12px; color:#fff; font-style: normal; border-radius: 4px; background: #2e97ea; display: none;}
</style>
<script type="text/javascript">
window.onload = function(){
var containerId = 'jesgoo-id-container';
var resetSize = function () {
var containerEle = document.getElementById(containerId);
var win = window;
var winW = win.innerWidth;
var winH = win.innerHeight;
var fzW, fzH;
if (winW / winH < 5 / 2) {
fzW = winW / 300 * 20;
fzH = 1000;
}
else {
fzW = 1000;
fzH = winH / 96 * 20;
}
var fz = fzW > fzH ? fzH : fzW;
containerEle.style.fontSize = fz + 'px';
};
//resetSize();
var aEle = document.getElementById("jesgoo-link");
var attrJSON = aEle.getAttribute("extra");
var attrObj = eval("("+ attrJSON +")");
var btn = document.getElementById('jesgoo-btn');
if(attrObj.act == 2){
btn.innerHTML = "下载";
}else{
btn.innerHTML = "查看";
}
btn.style.display = "block"
}
</script>
</head>
<body>
<div id="jesgoo-id-container" class="jesgoo-container">
<a target="_blank" id="jesgoo-link" class="jesgoo-content" style="text-decoration: none;" href=http://www.baidu.com extra="{'act':1,'pkg':'','title':'','adid':'0','durl':[''],'iurl':[''],'aurl':['']}">
<div class="jesgoo-text text">
<div class="jesgoo-title">分享:关键时刻不行怎么办</div>
<div class="jesgoo-desc"><marquee behavior="scroll" direction="left">只需一招 给她夜夜惊喜</marquee></div>
</div>
<i id="jesgoo-btn" class="jesgoo-btn">下载</i>
</a>
</div>
</body>
</html>
以上这个物料在ios 320*50的UIWebView iphone的设备上(iPhone5 iPhone4)上右侧有下载或查看按键
但是 这个物料在ios 320*50的UIWebView ipad的设备上 没有看到右侧按键
原因是下面的 content="width=device-width, user-scalable=no, initial-scale=1.0" 设置的content的宽为设备的宽度 button的位置是做了对右偏移的控制 在ipad上device-width 是728 实际button的x位置是716 但是webview 只有320宽度,所以看不到了。使用中注意这个。
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0">
<style>
html5 中meta中 content=width=device-width注意的更多相关文章
- <head>中<meta name="viewport" content="width=device-width,initical-scale=1"的作用>
<meta name="viewport" content="width=device-width,initical-scale=1"的作用> co ...
- HTML5移动开发中的meta与link
meta HTML5移动开发中的一些webkit专属头部标签,能够帮助浏览器更好的解析HTML代码,从而为HTML5移动开发提供更好的前端表现与体验 viewport网页缩放 1 <meta n ...
- HTML5头部标签中<meta>常用信息
整理一些平时常用的,方便查阅 <!-- 字体编码 --> <meta charset="utf-8" /> <!-- 关键字 --> <m ...
- 如何理解VB窗体中的scale类属性及width height属性之间的关系
如何理解VB窗体中的scale类属性及width height属性之间的关系 VB中的SCALEHIEGT,SCALEWIDTH,与窗体中的WIDTH,HEIGHT的区别及关系是许多VB初学者难以理解 ...
- HTML5在canvas中绘制复杂形状附效果截图
HTML5在canvas中绘制复杂形状附效果截图 一.绘制复杂形状或路径 在简单的矩形不能满足需求的情况下,绘图环境提供了如下方法来绘制复杂的形状或路径. beginPath() : 开始绘制一个新路 ...
- HTML中<meta>标签如何正确使用
HTML中<meta>标签如何正确使用 如果我们在浏览器中按下F12或者Ctrl+shift+J,便可以打开开发者工具,在element中即可看到<head>元素中有不少< ...
- 我刚知道的WAP app中meta的属性
之前我一直做的都是WEB前端开发,来北京以后面试了一个移动前端开发,WAP前端开发. 其实在原来公司的时候也做过这方面的开发,可面试的时候面试官问我,要想强制让文档与设备的宽度保持1:1,mate标签 ...
- 我刚知道的WAP app中meta的属性(转载)
之前我一直做的都是WEB前端开发,来北京以后面试了一个移动前端开发,WAP前端开发. 其实在原来公司的时候也做过这方面的开发,可面试的时候面试官问我,要想强制让文档与设备的宽度保持1:1,mate标签 ...
- html中meta标签及用法理解
自己一直想成为高级前端开发工程师,而自学.奈何最近感觉自学收效甚微,一度迷茫. 不破不立,打算改变这样的状态. 春节后上班第一天,今年打算好好实现自己的前端梦想. 重新整理.总结前端技术. 废话,就不 ...
随机推荐
- 局域网络ping不通
描述:今天和老崔.老周去公司的新办公地点//相比临时的,十分高大上.当我们把两台台式电脑A.B装好了,网络设置也陪好了,确认能够上网,再装打印机的时候,发现搜索不到打印机的ip(打印机也是有自己的IP ...
- GCC编译器
详见<gcc中文手册> 编译过程 预处理器cpp 编译器gcc 汇编器as 链接器linker file.c -------------> file.i ----------- ...
- 黑马程序员——JAVA基础之简述集合collection
------- android培训.java培训.期待与您交流! ---------- 集合: 为什么出现集合类? • 面向对象语言对事物的体现都是以对象的形式,所以为了方便对多个对象的操作,就对对 ...
- java的nio之:浅析I/O模型
也许很多朋友在学习NIO的时候都会感觉有点吃力,对里面的很多概念都感觉不是那么明朗.在 进入Java NIO编程之前,我们今天先来讨论一些比较基础的知识:I/O模型.下面本文先从同步和异步的概念 说起 ...
- python3基础语法
一.编码 默认情况下, python3源码文件以UTF-8编码,所有字符串都是unicode字符串.当然你也可以为源码文件指定不同的编码: # -*- coding: gbk -*- 二.标识符 1. ...
- Using CSV-Format Log Output
Including csvlog in the log_destination list provides a convenient way to import log files into a da ...
- 012. asp.net生成验证码图片(汉字示例/字母+数字)
protected void Page_Load(object sender, EventArgs e) { //生成验证码图片的基本步骤 string checkCode = "新年快乐& ...
- Open vSwitch
https://github.com/openvswitch/ovs/blob/master/INSTALL.RHEL.md
- 下载word文档
来源:http://www.cnblogs.com/damonlan/archive/2012/04/28/2473525.html 作者:浪迹天涯 protected void GridView1_ ...
- OpenJudge计算概论-单词替换
/*====================================================================== 单词替换 总时间限制: 1000ms 内存限制: 65 ...