搜索
首页php教程php手册php实战第十七天

php实战第十七天

Jun 13, 2016 am 10:57 AM
cssphpposition学习实战布局方法

今天学习到了一个非常神奇的css布局方法

position: absolute;
top:61px;
bottom: 0px;


把 position设置为 absolute 后 top就是顶边拉 left就是左边拉

那么如果把 底边调成0.嘿嘿,是不是变成窗口自适应了?

做这个的时候想过 直接设置 height:100%.但是这是无效帝,,,具体为什么我也不知道哈...


[css]
#head{ 
    width:100%; 
    height:61px; 
     
    border-bottom:solid 1px #ccc; 
 
    background-image:url(../img/topbg.gif); 
    background-repeat:repeat-x; 
    } 
#logo{ 
    width:189px; 
    height:61px; 
    background-image:url(../img/logo_dmin.png); 
    } 
#left{ 
    padding-top:15px; 
    width:205px; 
    height:auto; 
    overflow-y:auto; 
    background-image: url(../img/leftbg.gif); 
 
    position: absolute; 
    top:61px; 
    bottom: 0px; 
    } 
#left h4{ 
    margin-left:18px; 
    background-image:url(../img/menuf.gif); 
    height: 20px; 
    width: 160px; 
    font-size: 12px; 
    text-align: center; 
    line-height:20px; 
    //font-weight:normal; 

#left li{ 
    padding-top: 5px; 
    padding-bottom: 5px; 
    padding-left:36px; 
    cursor: pointer; 
    color:#555; 
    font-size: 12px; 

 
#right{ 
    overflow-y:auto; 
    position: absolute; 
    top:61px; 
    left: 205px; 
    bottom:0px; 
    right:0px; 
    } 

#head{
 width:100%;
 height:61px;
 
 border-bottom:solid 1px #ccc;

 background-image:url(../img/topbg.gif);
 background-repeat:repeat-x;
 }
#logo{
 width:189px;
 height:61px;
 background-image:url(../img/logo_dmin.png);
 }
#left{
 padding-top:15px;
 width:205px;
 height:auto;
 overflow-y:auto;
 background-image: url(../img/leftbg.gif);

 position: absolute;
 top:61px;
 bottom: 0px;
 }
#left h4{
 margin-left:18px;
 background-image:url(../img/menuf.gif);
 height: 20px;
 width: 160px;
 font-size: 12px;
 text-align: center;
 line-height:20px;
 //font-weight:normal;
}
#left li{
 padding-top: 5px;
 padding-bottom: 5px;
 padding-left:36px;
 cursor: pointer;
 color:#555;
 font-size: 12px;
}

#right{
 overflow-y:auto;
 position: absolute;
 top:61px;
 left: 205px;
 bottom:0px;
 right:0px;
 }html的代码为


[html]

 
 
   

文章管理

 
   
     
           
  • 添加栏目
  •  
           
  • 添加文章
  •  
           
  • 管理文章
  •  
       
 
   

网站管理

 
   
     
           
  • 基本设置
  •  
           
  • 其他
  •  
       
 
 
 
 
声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

功能强大的PHP集成开发环境

螳螂BT

螳螂BT

Mantis是一个易于部署的基于Web的缺陷跟踪工具,用于帮助产品缺陷跟踪。它需要PHP、MySQL和一个Web服务器。请查看我们的演示和托管服务。

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)