窗口缩小时图片、文字跟着整体缩小
2015-08-19 16:00
260 查看
.content_left{width:48.5%; float:left; padding:3% 3% 0px 0px; display:block;}
.content_left img{min-width:100%;width:280px;vertical-align: middle;width:expression_r(document.body.clientWidth>100?"100%":"auto");
overflow:hidden;}
窗口缩小文字跟着自动缩小
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>CSS3 Demo</title>
<style type="text/css">
#box { width: 10em; padding: 15px; font-size: 1em;}
#box2 { font-size: 4vw;}
</style>
</head>
<body>
<div id="box">
Nihao a 你好 啊啊 啊啊 哈牛粪打款三幅画
</div>
<div id="box2">
我们都是好孩子啊啊2
</div>
<script type="text/javascript">
window.onresize = function(){
var box2 = document.getElementById("box2");
box2.style["z-index"] = 1;
}
</script>
</body>
</html>
.content_left img{min-width:100%;width:280px;vertical-align: middle;width:expression_r(document.body.clientWidth>100?"100%":"auto");
overflow:hidden;}
窗口缩小文字跟着自动缩小
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>CSS3 Demo</title>
<style type="text/css">
#box { width: 10em; padding: 15px; font-size: 1em;}
#box2 { font-size: 4vw;}
</style>
</head>
<body>
<div id="box">
Nihao a 你好 啊啊 啊啊 哈牛粪打款三幅画
</div>
<div id="box2">
我们都是好孩子啊啊2
</div>
<script type="text/javascript">
window.onresize = function(){
var box2 = document.getElementById("box2");
box2.style["z-index"] = 1;
}
</script>
</body>
</html>
相关文章推荐
- 纯源码编译安装LAMP,linux,httpd,php,mysql源码编译安装
- 工厂模式
- Aspose.Words使用教程之插入文档元素(二)【连载】
- js仿黑客帝国字母掉落效果代码分享
- 桌面支持--装了系统启动到windows进不去系统--硬盘模式没改
- WebX5 拍照上传功能
- hdu3709 (平衡数) 数位DP
- 防火墙DNAT与SNAT详谈
- 桌面支持--显示驱动程序停止响应,并已恢复 Windows Vista 或 Windows 7 中的错误消息
- 作为码农,我们为什么要写作
- HDU 3746 Cyclic Nacklace(KMP最小循环子串)
- AC自动机模板(数组实现版)
- 程序员的几个成长阶段
- 凸包,旋转卡壳模板
- @helper的使用
- memory alignment
- Javascript规范
- 桌面支持--电脑显示器变横了
- 鼠标移上去出现显示层,并且出现在同一个div中
- c++中static总结