一种大气简单的Web管理(陈列)版面设计

2014-11-23 20:26:53 · 作者: · 浏览: 7

在页面的设计中,多版面是一种常见的设计样式。本文命名一种 这样的样式,可以简单描述为一行top,一列左目录,剩余的右下的空间为内容展示区。这样的样式,便于快速定位到某项内容或功能。

在基本的HTML语法中,iframe可以提供多版面,方法简易,然而,本文主要在于推介一种利用Div实现版面控制的方法,这种方法可以利用div带来的更大灵活性。


首先,展示下最终实现的效果。
\
主页面采用这样的frame.css样式控制。


#framecontentTop
{
    position: absolute;
    top: 0;
    left: 0;
    height: 100px;
    width: 100%;
    overflow: hidden;
    vertical-align: middle;
    background-color: #D2E6FA;
}

#framecontentLeft
{
    position: fixed;
    top: 100px;
    left: 0;
    height: 100%;
    width: 150px;
    overflow: hidden;
    vertical-align: top;
    background-color: #D2E6FA;
}

#maincontent
{
    position: fixed;
    left: 150px;
    top: 100px;
    right: 0;
    bottom: 0;
    overflow: auto;
    background: #fff;
    border-top: solid 2px #70cbea;
    border-left: solid 2px #70cbea;
}

左侧menu菜单采用这样的menu.css

.menus
{
}
.menu ul
{
    padding: 0;
    margin: 0;
    list-style-type: none;
    width: 100%;
}
.menu li
{
    position: relative;
    background: #d4d8bd;
    height: 26px;
}
.menu a, .menu a:visited
{
    display: block;
    text-decoration: none;
    height: 25px;
    line-height: 25px;
    width: 149px;
    color: #000;
    text-indent: 5px;
    border: 1px solid #fff;
    border-width: 0 1px 1px 0;
}
.menu a:hover
{
    color: #fff;
    background: #949e7c;
}


主页面代码如下:



  

  



<script language="java script" type="text/java script">


function SetWinHeight(obj)
{
    var win=obj;
    if (document.getElementById)
    {
        if (win && !window.opera)
        {
            if (win.contentDocument && win.contentDocument.body.offsetHeight)
                win.height = win.contentDocument.body.offsetHeight;
            else if(win.Document && win.Document.body.scrollHeight)
                win.height = win.Document.body.scrollHeight;
        }
    }
}










  

Manage Center

html>

其中,SetWinHeight是为了让子页面高度自适应。


至于要展示的页面,只要是一个正常的网页即可。