一套後台管理html模版

來源:互聯網
上載者:User

標籤:des   style   blog   http   color   使用   os   strong   

最近自己需要一套後台管理的模版,然後去網上尋找,模版的確很多,但是適合我的並不多。我需要的模版是不會很大,我能夠控制碼,樣式不要太古樸,最好有點CSS3的效果。最後終於找到一張首頁,然後再根據這個首頁來編輯其他的後台部分。第一眼看到這個樣式,就非常滿意。現在只做了四張頁面,登入、首頁、菜單管理和菜單添加頁面。

瀏覽器安全色是盡量做到IE8以上可以使用,firefox、chrome瀏覽器等能完全相容。由於IE8無法解析CSS3,所以有些地方會額外的製作CSS。下面的代碼都不是完整的代碼,完整代碼可以參考下載的demo。

 

 

一、頁面大量使用了HTML5與CSS3

自己對於html5的理解一直很膚淺,缺少想象力,這次通過這個模版頁面可以更多的瞭解到這些標籤在什麼場合下比較適合用。很多地方也用到了選取器,拓寬了自己的眼見。左側邊欄的小表徵圖原先是用img展示的,現在都被我換成了icon字型了,直接通過icomoon網站線上擷取,使用icon字型將很容易控制樣式以及大小。

<header id="header">        <hgroup>            <h1 class="site_title"><a href="index.html">Website Admin</a></h1>            <h2 class="section_title">Dashboard</h2><div class="btn_view_site"><a href="http://www.cnblogs.com/strick/">View Site</a></div>        </hgroup>    </header>
.quick_search input[type=text] {-webkit-border-radius: 20px;-moz-border-radius: 20px;border-radius: 20px;border: 1px solid #bbb;height: 26px;width: 90%;color: #ccc;-webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;-moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff;text-indent: 30px;background: #fff url(../images/icn_search.png) no-repeat;background-position: 10px 6px;}

 

二、寬度使用%比,複用更方便

這套模版全部是用%設定寬度,這次我也感受到了這種設定方式的便捷。模版只提供了首頁,登入頁面是後面自己加的。這個部分就是自己在最外層定義了一個寬度,裡面的根據百分比顯示,完全沒有走樣,也不用修改代碼。

<div class="w500 mc ovh">        <section id="main" >            <article class="module width_full">                <header><h3>登入</h3></header>            </article>        </section>    </div>

只是簡單的加了個<div class="w500 mc ovh">就完成了一個頁面配置。

 

三、通用美觀的提示

這個提示直接複製就可以,代碼很簡潔,樣式看著就是很舒服。

<h4 class="alert_info">Welcome to the free MediaLoot admin panel template, this could be an informative message.</h4><h4 class="alert_warning">A Warning Alert</h4><h4 class="alert_error">An Error Message</h4><h4 class="alert_success">A Success Message</h4>

 

四、通用table樣式

後來展示列表資訊,用table比較方便,寬度也是用%比展示,複製到各個頁面能夠很和諧的融入進去。用icon來展示操作,也很清晰。

 

五、CSS3按鈕

一直就想試試用CSS3來製作按鈕特效了,這次終於有機會啦,在網上找了一套,自己做了些細微修改,並做了瀏覽器的相容。

效果的確不錯,但是CSS的代碼一下子就增加了好多,而且為了能讓IE8這些不相容CSS3的瀏覽器能達到差不多的效果,還額外寫了點CSS,通過JS外掛程式modernizr輔助。

a.button {    display:inline-block;    position: relative;    height: 25px;    width: 80px;    margin: 0 10px 18px 0;        text-decoration: none;    font: 12px "Helvetica Neue", Helvetica, Arial, sans-serif;    font-weight: bold;    line-height: 25px;    text-align: center;        -webkit-border-radius: 3px;     -moz-border-radius: 3px;    border-radius: 3px;      }  a.button:before,  a.button:after {    content: ‘‘;    position: absolute;    left: -1px;    height: 25px;    width: 80px;    bottom: -1px;        -webkit-border-radius: 3px;     -moz-border-radius: 3px;    border-radius: 3px;  }  a.button:before {     height: 23px;    bottom: -4px;    border-top: 0;        -webkit-border-radius: 0 0 3px 3px;     -moz-border-radius: 0 0 3px 3px;    border-radius: 0 0 3px 3px;        -webkit-box-shadow: 0 1px 1px 0px #bfbfbf;    -moz-box-shadow: 0 1px 1px 0px #bfbfbf;    box-shadow: 0 1px 1px 0px #bfbfbf;  }/* MODERNIZR FALLBACK */  .no-cssgradients a.button, .no-cssgradients a.button:visited,  .no-borderradius a.button, .no-borderradius a.button:visited,  .no-generatedcontent a.button, .no-generatedcontent a.button:visited {    background: url(../images/img_btn.png) no-repeat 0 0px;    height: 32px;    width: 82px;  }

 

六、CSS3分頁

這個也是後面自己添加上去的,挺融入這個風格中的,在裡面也加了些CSS3的元素

ul.paginationA01 li a{    color:#474747;    border:solid 1px #B6B6B6;    padding:6px 9px 6px 9px;    background:#E6E6E6;    background:-moz-linear-gradient(top,#FFFFFF 1px,#F3F3F3 1px,#E6E6E6);    background:-webkit-gradient(linear,0 0,0 100%,color-stop(0.02,#FFFFFF),color-stop(0.02,#F3F3F3),color-stop(1,#E6E6E6));}        ul.paginationA01 li a:hover,ul.paginationA01 li a.current{    background:#FFFFFF;}ul.paginationA01 li a:active{    background:#D9D9D9;    background:-moz-linear-gradient(top,#FFFFFF 1px,#EAEAEA 1px,#b6b6b6);    background:-webkit-gradient(linear,0 0,0 100%,color-stop(0.02,#FFFFFF),color-stop(0.02,#EAEAEA),color-stop(1,#b6b6b6));    }

 

七、單元測試的模組

在tests檔案夾下面,我已經添加好單元測試的模組,能夠讓自己以後的JS指令碼代碼更加的健壯。

 

通過上面的幾個分解模組,基本上可以滿足後台管理各個部分的樣式需求,自己也可以有一套能修改的管理模版啦!

 

demo下載:

http://download.csdn.net/download/loneleaf1/7711311

 

參考資料:

http://medialoot.com/preview/admin-template/index.html 網頁後台模版
http://webdesign.tutsplus.com/tutorials/orman-clarks-chunky-3d-web-buttons-the-css3-version--webdesign-5731 按鈕製作
http://icomoon.io/ 自己製作icon

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.