Ace Admin前端框架笔记一概要与布局介绍
一 簡要
Ace Admin官網?http://ace.jeka.by/
Ace Admin Git??https://github.com/bopoda/ace
Ace是一款輕量且功能豐富的管理模板,干凈且易于使用。?
當前版本具有以下功能:
- ?4種不同的皮膚
- ?基于Bootstrap 3的響應式設計(特別是3.1.1)
- ?使用Javascript和CSS構建器來構建您自己的最小文件
- ?在頁面幫助中,您可以輕松選取任何元素并查看其工作原理
- ?自定義元素和插件
- ? ???Bootstrap,jQuery UI和第三方插件和元素
文件目錄介紹
從git下載源碼ace-master并解壓
此目錄為html文件,按字母順序排列
如果您想查看HTML頁面的總體布局,您可以從blank.html開始,它里面沒有任何組件,具有最少代碼。
assets為一些資源文件,具體就不介紹了
使用
頁面布局
1)?Navbar導航欄
內部主容器區域:
2)Sidebar側邊欄
3)Breadcrumbs面包屑(在“主要內容”中)
4)?Page conten頁面內容(在“主要內容”中)
5)?Settings box設置框(在“頁面內容”內)
6)Footer頁腳
<!DOCTYPE html> <html lang="en"><head><!-- title, meta tags, list of stylesheets, etc ... --></head><body class="no-skin"><div class="navbar" id="navbar"><!-- 1 導航欄 navbar goes here --></div><!-- 主容器 --><div class="main-container" id="main-container"><div class="sidebar responsive" id="sidebar"><!-- 2 側邊欄 sidebar goes here --></div><!-- 主要內容/.main-content --><div class="main-content"><!-- 3 面包屑 breadcrumbs goes here --><div class="breadcrumbs"></div><!-- 4 頁面內容/.page-content --><div class="page-content"><!-- 5 設置框 setting box goes here if needed --><div class="row"><div class="col-xs-12"><!--page content goes here --></div><!-- /.col --></div><!-- /.row --></div></div><!-- 6 頁腳 footer area --></div><!-- /.main-container --><!-- list of script files --></body> </html>頭元素
<!DOCTYPE html> <html lang="en"><head><meta charset="utf-8" /><!-- use the following meta to force IE use its most up to date rendering engine --><!-- 使用下面的meta來強制IE使用其最新的渲染引擎 --><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title> page tite </title><meta name="description" content="page description" /><!-- 樣式表stylesheets are put here, refer to files/css documentation --><!-- 腳本 some scripts should be here, refer to files/javascript documentation --></head>head?元素包含標題,元標記,樣式表和一些腳本
CSS文件順序
The correct order of including CSS files is as follows:正確的css順序如下
1 bootstrap.css
2 fontawesome.css if you want to use Fontawesome icons.
3 ace-fonts.css?
You may want to serve fonts from your own server or hosted by Google.?
如果需要自定義字體
View this file for an example:?
fonts.mustache
4 Third party css files? 第三方css文件 such as chosen.css or ui.jqgrid.css
5 ace.css. Ace's main CSS file.
6 ace-part2.css. IE 9 and below have a 4096 selector limit. 這個一般沒用
7 ace-skins.css. Ace skin CSS file, if you want to use a skin other that default one.?
You can also compile default Ace styles (ace.css) using a different skin.
Ace皮膚CSS文件,如果你想使用其他默認的皮膚。?
8 ace-rtl.css。Ace的RTL方向CSS文件,如果你想使用阿拉伯語,希伯來語或波斯語。這個也沒用
9 ace-ie.css which is used by IE9 and below. 由IE9及以下版本使用。
10 內聯樣式,這個不推薦 Inline styles which is not recommend and you should always try to separate your CSS from your HTML and application code.
例子:
<link href="path/to/bootstrap.min.css" rel="stylesheet" /><link href="path/to/fontawesome.min.css" rel="stylesheet" /><!-- only if needed --><link href="path/to/ace-fonts.css" rel="stylesheet" /><!-- you can also use google hosted fonts --> <link href="path/to/ace.min.css" rel="stylesheet" /><!--[if lte IE 9]><link href="path/to/ace-part2.min.css" rel="stylesheet" /><![endif]--><link href="path/to/ace-skins.min.css" rel="stylesheet" /><!-- only if needed --><link href="path/to/ace-rtl.min.css" rel="stylesheet" /><!-- only if needed --><!--[if lte IE 9]><link href="path/to/ace-ie.min.css" rel="stylesheet" /><![endif]--><style>/* not recommended to define new CSS rules inside your HTML page */.some-selector {color: red;}</style>Script 順序
The right order of including script files is:script文件的正確順序
Scripts that are inside HEAD element:?
(also visible in styles.mustache)
1 ace-extra.js?
if you need cookie support and sidebar collapse/expand, fixing navbar, etc.
如果您需要Cookie支持和側邊欄折疊/展開,導航欄等。
2 html5shiv.min.js & respond.min.js wrapped inside IE conditional comments which enable some HTML5 features on IE8 and below.
<head><script src="ace-extra.min.js"></script><!--[if lte IE 8]><script src="html5shiv.min.js"></script><script src="respond.min.js"></script><![endif]--></head>3 Other scripts that are preferrably at the end of document:?其他腳本最好放在文檔末尾
? ? 3.1 jquery.js as well as jquery v1.x which is included for IE9 and below.?
? ? jquery.js should be inside special IE conditional comments and it will be ignored by IE9 and below.?
jquery v1.x should be inside conditional comments so that it's included by IE9 and below only.
? ? 3.2 bootstrap.js
? ?3.3 excanvas.js for IE8 if you are going to need HTML5 Canvas support. Currently plugins that need canvas support are:
Flotchart
Sparklines
jQuery Knob
Easy Pie Chart
4 You should include excanvas before including above plugins.
? Any Plugin that you want to use for example:?
Chosen?
Fuelux Wizard
5 Finally you should include ace-elements.js and ace.js
6 And then inline scripts that you may want to use for the page.
例子:
<!--[if !IE]> --> <script src="jquery.min.js"></script><!-- <![endif]--><!--[if lte IE 9]><script src="jquery1x.min.js"></script><![endif]--><script src="bootstrap.min.js"></script> <!-- ie8 canvas if required for plugins such as charts, etc --><!--[if lte IE 8]><script src="excanvas.min.js"></script><![endif]--> <script src="plugin1.min.js"></script><script src="plugin2.min.js"></script><script src="plugin3.min.js"></script> <script src="ace-elements.min.js"></script><script src="ace.min.js"></script><script type="text/javascript">//If page has any inline scripts, it goes herejQuery(function($) {alert('hello!');});</script></body>Viewport meta tag
請注意,使用移動設備時,用戶放大/縮小時頁面可能看起來不太好,尤其是在導航欄或邊欄被調整時。?一種選擇是防止用戶使用user-scalable=no屬性放大/縮小:
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />Body element
<body class="no-skin">...</body>目前有4個可用的邊框可以改變邊欄和導航欄的顏色,它們是:
文件末尾
可以防止腳本文件和內聯腳本
空布局
見blank.html,他是默認布局
<html><head><!-- title, meta tags, list of stylesheets, etc ... --></head><body class="no-skin"><div class="navbar" id="navbar"><!-- navbar goes here --></div><div class="main-container" id="main-container"><div class="sidebar responsive" id="sidebar"><!-- sidebar goes here --></div><div class="main-content"><div class="page-content"><div class="row"><div class="col-xs-12"><!-- page content goes here --></div><!-- /.col --></div><!-- /.row --></div><!-- /.page-content --></div><!-- /.main-content --></div><!-- /.main-container --><!-- list of script files --></body></html>不過我現在下載的版本空文件有點變化,包含了許多不必要的元素,剛開始看起來有點困難,
我把他的css 和js 先貼下,這個很有用
<head><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><meta charset="utf-8" /><title>Blank Page - Ace Admin</title><meta name="description" content="" /><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /><!-- bootstrap & fontawesome --><link rel="stylesheet" href="assets/css/bootstrap.min.css" /><link rel="stylesheet" href="assets/font-awesome/4.5.0/css/font-awesome.min.css" /><!-- page specific plugin styles --><!-- text fonts --><link rel="stylesheet" href="assets/css/fonts.googleapis.com.css" /> <!-- ace styles --><link rel="stylesheet" href="assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" /><!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ace-part2.min.css" class="ace-main-stylesheet" /><![endif]--><link rel="stylesheet" href="assets/css/ace-skins.min.css" /><link rel="stylesheet" href="assets/css/ace-rtl.min.css" /><!--[if lte IE 9]> <link rel="stylesheet" href="assets/css/ace-ie.min.css" /><![endif]--><!-- inline styles related to this page --><!-- ace settings handler --><script src="assets/js/ace-extra.min.js"></script><!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries --><!--[if lte IE 8]><script src="assets/js/html5shiv.min.js"></script><script src="assets/js/respond.min.js"></script><![endif]--></head>
登錄布局
僅用于登錄頁面的登錄布局如下所示
以后我詳細介紹
總結
以上是生活随笔為你收集整理的Ace Admin前端框架笔记一概要与布局介绍的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: win10怎么修复网络连接服务器失败,微
- 下一篇: ES6箭头函数(节选自《ECMAScri