首 页
网络学院
视频教程
资源下载
HOT
实例教程
图文教程
专题中心
学习社区
繁體中文
当前位置:
首页
>
图文教程
>
网页制作
>
CSS样式表
> 两种跨浏览器的自适应高的css代码
CSS样式表
css分页样式代码
用css filter做鼠标滑过图片效果
有关于IE8 Beta 1两个提醒
css Hspace 和vspace的图片控制实例
firefox background-image垂直平铺问题的解决方法
发一个css比较清爽的写法
htm页面中<a name>加name和id的冲突附解决方法
javascript 获取特定的 CSS属性值
CSS教程之CSS的应用
html页面head区域的编码书写规范
html滚动条样式
不用图片作背景CSS做的小灯笼效果_练习用
网页绿色系配色应用实例图文
网页中英文混排行高不等问题的解决方法
CSS Hack 汇总速查手册浏览器兼容必会
css文本框与按钮美化效果代码
网页设计中的 serif 和 sans-serif字体应用
采用XHTML和CSS设计可重用可换肤的WEB站点的方法
CSS 浏览器的等宽空格问题解决
欲练CSS ,必先解决IE的一些细节分析
No.
«
‹
89
90
91
92
›
»
技术文章搜索
关键字
CSS样式表 中的 两种跨浏览器的自适应高的css代码
出处:
互联网
整理:
软晨网(RuanChen.com)
发布:
2010-01-10
浏览: 69 ::
收藏到网摘: n/a
重置浏览器默认样式
纯CSS无hacks的跨游览器自适应高度多列布局 推荐
好久没发了 ,今天刚学了点东东,顺便挖过来,happy一下
第一种:代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title></title> <style type="text/css"> .div1{width:30%;padding-bottom:32767px;margin-bottom:-32767px;float:left} .div2{width:40%;padding-bottom:32767px;margin-bottom:-32767px;float:left} .div3{width:30%;padding-bottom:32767px;margin-bottom:-32767px;float:left} </style> </head> <body> <div style="width:100%;overflow:hidden"> <div class="div1" style="background-color:Lime"> 1dd </div> <div class="div2" style="background-color:Fuchsia"> 2 </div> <div class="div3" style="background-color:Olive"> 一<br> 二<br> 三<br> 四<br> 五<br> 六<br> 七<br> 八<br> 九<br> </div> </div> </body> </html>
提示:您可以先修改部分代码再运行
说实话上面一种办法,我根本不理解
第二种方法,比较好理解,
采用相对定位,背景和文字是分离的
代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>无标题页</title> <style type="text/css"> *{margin:0px; padding:0px; font-size:12px;} #container3 { width:100%; background:red; float:left; position:relative; overflow:hidden; } #container2 { width:100%; background:yellow; float:left; position:relative; right:30%; } #container1 { width:100%; background:green; float:left; position:relative; right:40%; } #container1 .content1 { float:left; width:30%; position:relative; left:70%; white-space:normal; word-break:break-all; overflow:hidden; } #container1 .content2 { float:left; width:40%; position:relative; left:70%; white-space:normal; word-break:break-all; overflow:hidden; } #container1 .content3 { float:left; width:30%; position:relative; left:70%; white-space:normal; word-break:break-all; overflow:hidden; } </style> </head> <body> <div id="container3"> <div id="container2"> <div id="container1"> <div class="content1"> 撒打发似的发撒打发似的发撒旦法大赛分阿撒打发似的发速度飞洒地方是大夫撒旦法按时打发大沙发是的说法撒旦法撒旦发放撒打发似的发ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc </div> <div class="content2"> 123 </div> <div class="content3"> <br>d <br>d <br>d <br>d <br>d <br>d <br>d <br>d <br>d <br>d <br>d <br>d <br>d <br>d 阿撒打发似的发是法师的法师的法师打发的说法大事发生大法师法师法师打发似的发射的反对撒 </div> <div style="clear:both;"></div> </div> </div> </div> </body> </html>
提示:您可以先修改部分代码再运行
更详细的介绍请看下一篇文章。
重置浏览器默认样式
纯CSS无hacks的跨游览器自适应高度多列布局 推荐
评论 (0)
All
登陆
还没注册?