From d6de899b3784a5ed56600c557293e119cdbec980 Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Wed, 26 Oct 2016 00:14:15 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E6=A0=B7=E5=BC=8F=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0site-responsive=E6=A0=B7=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Dsidebar=E4=B8=8D=E9=80=9A=E5=88=86=E8=BE=A8?= =?UTF-8?q?=E7=8E=87=E4=B8=8B=E8=87=AA=E5=8A=A8=E9=9A=90=E8=97=8F=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/Bootstrap.Admin.csproj | 1 + Bootstrap.Admin/Content/css/admin.css | 30 ++++++--- Bootstrap.Admin/Content/css/fix.css | 10 +-- .../Content/css/site-responsive.css | 62 ++++++++++++++++++ Bootstrap.Admin/Content/css/site.css | 44 ++----------- Bootstrap.Admin/Content/js/_references.js | Bin 1912 -> 2010 bytes Bootstrap.Admin/Views/Shared/_Admin.cshtml | 17 +++-- Bootstrap.Admin/Views/Shared/_Default.cshtml | 2 +- 8 files changed, 104 insertions(+), 62 deletions(-) create mode 100644 Bootstrap.Admin/Content/css/site-responsive.css diff --git a/Bootstrap.Admin/Bootstrap.Admin.csproj b/Bootstrap.Admin/Bootstrap.Admin.csproj index 0a10d9e9..84af083d 100644 --- a/Bootstrap.Admin/Bootstrap.Admin.csproj +++ b/Bootstrap.Admin/Bootstrap.Admin.csproj @@ -112,6 +112,7 @@ + diff --git a/Bootstrap.Admin/Content/css/admin.css b/Bootstrap.Admin/Content/css/admin.css index 91bab8bf..5a013855 100644 --- a/Bootstrap.Admin/Content/css/admin.css +++ b/Bootstrap.Admin/Content/css/admin.css @@ -1,11 +1,27 @@ -#sidebar { +.wrapper { + display: inline-block; + padding: 15px; + width: 100%; +} + +.sidebar-closed > #sidebar > ul { + display: none; +} + +.sidebar-closed #main-content { + margin-left: 0px; +} + +.sidebar-closed #sidebar { + margin-left: -210px; +} + +#sidebar { width: 210px; - position: absolute; - top: 0; - bottom: 40px; + height: 100%; + position: fixed; background: #2a3542; overflow-y: scroll; - outline: none; margin-top: 94px; } @@ -131,7 +147,3 @@ ul.sidebar-menu { transition: all 0.3s ease; color: #aeb2b7; } - -.row { - margin-left: 210px; -} diff --git a/Bootstrap.Admin/Content/css/fix.css b/Bootstrap.Admin/Content/css/fix.css index b69668af..baddb404 100644 --- a/Bootstrap.Admin/Content/css/fix.css +++ b/Bootstrap.Admin/Content/css/fix.css @@ -3,14 +3,14 @@ overflow: hidden; } -.row { +#main-content { + margin-left: 210px; position: fixed; - overflow: auto; - top: 0; left: 0; - right: 0; bottom: 40px; - padding-top: 16px; + right: 0; + top: 94px; + overflow: auto; } .site-footer { diff --git a/Bootstrap.Admin/Content/css/site-responsive.css b/Bootstrap.Admin/Content/css/site-responsive.css new file mode 100644 index 00000000..43c96772 --- /dev/null +++ b/Bootstrap.Admin/Content/css/site-responsive.css @@ -0,0 +1,62 @@ +@media screen and (-webkit-min-device-pixel-ratio:0) { + /* Safari and Chrome */ + .dropdown-menu.extended { + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.176) !important; + } +} + +@media (min-width: 980px) { + .modal-dialog { + width: 800px; + } +} + +@media (max-width: 979px) { + .panel-body { + padding-top: 0px; + } + + .panel-body .form-inline .form-group { + margin-top: 15px; + margin-bottom: 0; + } +} + +@media (max-width: 768px) { + .sidebar-close #sidebar { + height: auto; + overflow: hidden; + overflow-y: auto; + position: absolute; + z-index: 1001; + display: block; + } + + #sidebar { + display: none; + } + + #main-content { + margin: 0px !important; + position: none !important; + } + + .top-nav { + position: absolute; + right: 10px; + top: 0px; + } +} + +@media (max-width: 480px) { + .top-nav ul.top-menu > li { + float: right; + } + + .top-nav .search { + display: none; + } +} + +@media (max-width:320px) { +} diff --git a/Bootstrap.Admin/Content/css/site.css b/Bootstrap.Admin/Content/css/site.css index 105c0943..0e504120 100644 --- a/Bootstrap.Admin/Content/css/site.css +++ b/Bootstrap.Admin/Content/css/site.css @@ -35,12 +35,6 @@ div button span { margin-top: 108px; } -.row { - margin-left: 0; - margin-right: 0; - margin-top: 92px; -} - .header, .footer { min-height: 60px; padding: 0 15px; @@ -308,13 +302,6 @@ a.logo { display: block; } -@media screen and (-webkit-min-device-pixel-ratio:0) { - /* Safari and Chrome */ - .dropdown-menu.extended { - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.176) !important; - } -} - /*Login*/ .form-signin { width: 330px; @@ -387,41 +374,18 @@ a.logo { /*end login*/ -/*bootstrap table 下边距*/ -.table-body { - padding: 0px 8px; -} - .form-inline .form-group label.control-label { margin-right: 10px; -} - -@media (min-width: 768px) { - .form-inline .form-group { - margin-bottom: 15px; - } - - .panel-body { - padding-bottom: 0; - } -} - -@media (max-width: 768px) { - .panel-body { - padding-bottom: 0; - } + width: 80px; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; } .modal-body { padding-bottom: 0; } -@media (min-width: 992px) { - .modal-dialog { - width: 800px; - } -} - .modal-header { background-color: #f5f5f5; border-top-left-radius: 6px; diff --git a/Bootstrap.Admin/Content/js/_references.js b/Bootstrap.Admin/Content/js/_references.js index 1921e1f98d371a461e700a2b92eef74625827ddd..3bef2533e135ef77ce088ad41f6210d19bb4e673 100644 GIT binary patch delta 39 vcmeytcZ+|+D>m_9hGd2!hD?S6h7yKi27Lx!hE#?;hSJH5?9r2dvDE + @RenderSection("css", false) @@ -19,15 +20,17 @@ @RenderSection("Javascript", false) } -@RenderSection("header", false) -@RenderSection("navigator", false)
-
-
-
- @RenderBody() + @RenderSection("header", false) + @RenderSection("navigator", false) +
+
+
+
+ @RenderBody() +
-
+
diff --git a/Bootstrap.Admin/Views/Shared/_Default.cshtml b/Bootstrap.Admin/Views/Shared/_Default.cshtml index cef2bfbf..d71c39ad 100644 --- a/Bootstrap.Admin/Views/Shared/_Default.cshtml +++ b/Bootstrap.Admin/Views/Shared/_Default.cshtml @@ -60,7 +60,7 @@
查询结果
-
+
\ No newline at end of file