我需要一个看起来像这样的主屏幕,但我不能让它在移动和桌面上工作。 所有导航栏都需要修复,然后第二个导航栏需要折叠,并在移动时使用侧栏。
任何建议都会有所帮助! mobile and desktop 这里是我的https://jsfiddle.net/jweldon/nrphdafs/
/*---------------- NAVBAR STUFF -------------------*/
body {
margin-top: 50px;
}
body, html {
height: 100%;
}
/* remove outer padding *navbar-lowsecond-navbarer/
.main .row{
padding: 0px;
margin: 0px;
}
/*Remove rounded coners*/
.second-navbar {
width: 100%;
float: right;
padding-left: 12%;
position: relative;
}
body > nav.navbar.navbar-inverse.sidebar {
background-color: lightgray;
}
#bs-sidebar-navbar-collapse-1 > ul > li > a {
color: black;
}
#bs-sidebar-navbar-collapse-1 > ul > li > a:hover {
background-color: darkgray;
}
#bs-sidebar-navbar-collapse-1 > ul > li > a:active {
color: white;
background-color: blue;
}
#games-nav > ul > li > a {
color: white;
width: 100%;
border-color: white;
text-transform: uppercase;
font-weight: bold;
height: 50px;
margin-right: 10px;
}
#li-scrabble {
background-color: green;
}
#li-go {
background-color: orange;
}
#li-chess {
background-color: blue;
}
#li-mtg {
background-color: black;
}
nav.sidebar, .main {
-webkit-transition: margin 200ms ease-out;
-moz-transition: margin 200ms ease-out;
-o-transition: margin 200ms ease-out;
transition: margin 200ms ease-out;
}
/* Add gap to nav and right windows.*/
.main {
padding: 10px 10px 0 10px;
}
/* .....NavBar: Icon only with coloring/layout.....*/
/*small/medium side display*/
@media (min-width: 768px) {
/*Allow main to be next to Nav*/
.main {
position: absolute;
width: calc(100% - 40px); /*keeps 100% minus nav size*/
margin-left: 40px;
float: right;
}
/*lets nav bar to be showed on mouseover*/
nav.sidebar:hover + .main {
margin-left: 200px;
}
/*Center Brand*/
nav.sidebar.navbar.sidebar > .container .navbar-brand, .navbar > .container-fluid .navbar-brand {
margin-left: 0px;
}
/*Center Brand*/
nav.sidebar .navbar-brand, nav.sidebar .navbar-header {
text-align: center;
width: 100%;
margin-left: 0px;
}
/*Center Icons*/
nav.sidebar a {
padding-right: 13px;
}
/*adds border top to first nav box */
nav.sidebar .navbar-nav > li:first-child {
border-top: 1px #e5e5e5 solid;
}
/*adds border to bottom nav boxes*/
nav.sidebar .navbar-nav > li {
border-bottom: 1px #e5e5e5 solid;
}
/* Colors/style dropdown box*/
nav.sidebar .navbar-nav .open .dropdown-menu {
position: static;
float: none;
width: auto;
margin-top: 0;
background-color: transparent;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
/*allows nav box to use 100% width*/
nav.sidebar .navbar-collapse, nav.sidebar .container-fluid {
padding: 0 0px 0 0px;
}
/*colors dropdown box text */
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
color: #777;
}
/*gives sidebar width/height*/
nav.sidebar {
width: 200px;
height: 100%;
margin-left: -160px;
float: left;
z-index: 8000;
margin-bottom: 0px;
}
/*give sidebar 100% width;*/
nav.sidebar li {
width: 100%;
}
/* Move nav to full on mouse over*/
nav.sidebar:hover {
margin-left: 0px;
}
/*for hiden things when navbar hidden*/
.forAnimate {
opacity: 0;
}
}
/* .....NavBar: Fully showing nav bar..... */
@media (min-width: 1330px) {
nav.sidebar.navbar {
border-radius: 0;
position: fixed;
}
/*Allow main to be next to Nav*/
.main {
width: calc(100% - 200px); /*keeps 100% minus nav size*/
margin-left: 200px;
}
/*Show all nav*/
nav.sidebar {
margin-left: 0px;
float: left;
}
/*Show hidden items on nav*/
nav.sidebar .forAnimate {
opacity: 1;
}
}
nav.sidebar .navbar-nav .open .dropdown-menu > li > a:hover, nav.sidebar .navbar-nav .open .dropdown-menu > li > a:focus {
color: #CCC;
background-color: transparent;
}
nav:hover .forAnimate {
opacity: 1;
}
section {
padding-left: 15px;
}
@media (max-width:767px) {
.second-navbar {
width: 100%;
top: 0px;
}
#wrapper {
padding-left: 0;
}
#sidebar-wrapper {
left: 0;
}
#wrapper.active {
position: relative;
left: 250px;
}
#wrapper.active #sidebar-wrapper {
left: 250px;
width: 250px;
transition: all 0.4s ease 0s;
}
}
footer {
position: fixed;
bottom: 0px;
height: 100px;
width: 100%;
clear: both;
}
footer legend {
color: white;
}
/*FLAG CSS*/
.flag-language-select {
height: 40px;
width: 40px;
margin-left: -40px;
margin-right: 20px;
}
/*CAROUSEL IMAGE*/
img.bg {
/* Set rules to fill background */
min-height: 100%;
min-width: 1024px;
/* Set up proportionate scaling */
width: 100%;
height: auto;
/* Set up positioning */
position: fixed;
top: 0;
left: 0;
}
@media screen and (min-width: 1200px) { /* Specific to this particular image */
#tag-line {
}
}
@media screen and (max-width: 1024px) { /* Specific to this particular image */
img.bg {
left: 50%;
margin-left: -512px; /* 50% */
}
}
/* CSS used here will be applied after bootstrap.css */
@media (max-width: 767px) {
.content {
padding: 15px;
margin-top: 10px;
}
}
@media (min-width: 768px) {
#menu-bar .panel {
margin-bottom: 0;
background-color: rgba(0,0,0,0);
border: none;
border-radius: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
#menu-bar li a {
color: #fff;
font-size: 16px;
font-weight: bold;
}
#side-navbar {
float: left;
width: 200px;
height: 100%;
}
.content {
margin-left: 200px;
min-height: 100%;
margin-top: 60px;
}
.container {
margin-left: 10px;
padding-right: 150px;
min-width: 100%;
}
}
#top-nav {
background-color: white;
}
#logo {
width: 25%;
height: auto;
}
.navbar-brand > h3 {
margin-top: 0;
margin-bottom: 0;
}
.body-content {
padding-left: 15px;
padding-right: 15px;
}
#side-navbar {
margin-top: 118px;
}
.navbar-collapse {
z-index: 1200;
}
/* Set padding to keep content from hitting the edges */
.body-content {
padding-left: 15px;
padding-right: 15px;
}
/* Override the default bootstrap behavior where horizontal description lists
will truncate terms that are too long to fit in the left column
*/
.dl-horizontal dt {
white-space: normal;
}
/* Set width on the form input elements since they're 100% wide by default */
input,
select,
textarea {
max-width: 280px;
}
label > input { /* HIDE RADIO */
visibility: hidden; /* Makes input not-clickable */
position: absolute; /* Remove input from document flow */
}
label > input + img { /* IMAGE STYLES */
cursor: pointer;
border: 2px solid transparent;
}
label > input:checked + img { /* (RADIO CHECKED) IMAGE STYLES */
border: 1px solid #00bfff;
}
.radio-img {
max-height: 20px;
}