工作需要,要做一个手机自适应的网页效果,终于搞定,先分享并记录! 其实主要就是改掉HTML页面声明: 在网页中加入以下代码,就可以正常显示了: 复制代码代码如下: 解释: width - viewport的宽度 height - viewport的高度 initial-scale - 初始的缩放比例...
分类:
Web程序 时间:
2015-02-02 15:28:52
阅读次数:
229
Parent page:document.domain = 'xxxx.com'function fixIframeHeight(h,iframe){ $(iframe).height(h);}Iframe page:document.domain = 'xxxx.com'console.lo...
分类:
其他好文 时间:
2015-02-02 14:02:50
阅读次数:
74
/// /// Sets the viewport. /// /// F width. /// F height. public static void SetViewport(float fWidth, float fHei...
分类:
其他好文 时间:
2015-02-02 13:59:49
阅读次数:
154
严谨纯净的HTML代码: 1、元素 ? ? 1)必须正确嵌套 ? ? 2)必须始终关闭<br />,<input /> ? ? 3)必须小写 ? ? 4)必须有一个根元素 2、属性 ? ? 1)必须使用小写 ? ? 2)必须用引号包围width="10",height...
分类:
Web程序 时间:
2015-02-02 10:57:14
阅读次数:
136
Window.resizeTo() 调整窗口大小 摘要window.resizeTo(width,height)参数width 想要调整到的窗口宽度。height 想要调整到的窗口高度。描述方法resizeTo()将调整窗口的大小,把它的宽度调整为width个像素,把它的高度调整为height...
<TextView
????????android:layout_width="wrap_content"
????????android:layout_height="wrap_content"
????????android:text="@string/hello_world"
????????android:id="@+i...
分类:
编程语言 时间:
2015-02-01 23:24:46
阅读次数:
367
1,主界面<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"android:paddingBottom="@dimen/activity_vertical_margin"..
分类:
其他好文 时间:
2015-02-01 20:34:03
阅读次数:
168
思路:
浏览器大小改变会触发JS事件:window.onresize获得浏览器大小 减去 顶部+底部 得到中间区域大小
HTML:
CSS:
/* 韦哥说 这里是必须的,这才是真正项目用到的 */
html{
height: 100%:
}
body{
heigh...
分类:
其他好文 时间:
2015-02-01 17:51:27
阅读次数:
150
下面的HTML和CSS能够实现div的隔行变色:
#container div{
width:200px;
height:25px;
font-size:14px;
text-align:center;
color:#474747;
}
.even{
background-color: #EDEDED;
}
.odd{
ba...
分类:
Web程序 时间:
2015-02-01 12:09:11
阅读次数:
134
在应用开发中,有时我们需要用代码计算布局的高度,可能需要减去状态栏(status bar)的高度。状态栏高度定义在Android系统尺寸资源中status_bar_height,但这并不是公开可直接使用的,例如像通常使用系统资源那样android.R.dimen.status_bar_height。...
分类:
其他好文 时间:
2015-02-01 11:57:06
阅读次数:
137