Fix nav on destop
This commit is contained in:
parent
46f859bed8
commit
9ef94f51b6
@ -2,6 +2,7 @@ body{
|
||||
min-width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
@ -85,6 +86,7 @@ nav{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.topnav {
|
||||
background-color: #333;
|
||||
overflow: hidden;
|
||||
@ -149,7 +151,8 @@ nav{
|
||||
}
|
||||
|
||||
/* Add a dark background on topnav links and the dropdown button on hover */
|
||||
.topnav a:hover, .dropdown:hover .dropbtn {
|
||||
.topnav a:hover,
|
||||
.dropdown:hover .dropbtn {
|
||||
background-color: #555;
|
||||
color: white;
|
||||
}
|
||||
@ -165,14 +168,25 @@ nav{
|
||||
display: block;
|
||||
}
|
||||
|
||||
main
|
||||
{
|
||||
main {
|
||||
background-color: #eeeeee;
|
||||
}
|
||||
|
||||
.topnav.responsive .dropdown-content {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-height: 0;
|
||||
}
|
||||
|
||||
.dropbtn:hover + .dropdown-content {
|
||||
max-height: unset;
|
||||
}
|
||||
|
||||
|
||||
/* Medium screens */
|
||||
@media all and (max-width: 600px) {
|
||||
|
||||
/******* header *******/
|
||||
#header {
|
||||
/* When on medium sized screens, we center it by evenly distributing empty space around items */
|
||||
@ -195,11 +209,13 @@ main
|
||||
|
||||
/* Small screens */
|
||||
@media all and (max-width: 500px) {
|
||||
|
||||
/******* header *******/
|
||||
#header {
|
||||
/* On small screens, we are no longer using row direction but column */
|
||||
flex-flow: column wrap;
|
||||
}
|
||||
|
||||
#header .flex-item {
|
||||
padding: 2px;
|
||||
margin: 2px;
|
||||
@ -210,9 +226,11 @@ main
|
||||
|
||||
/******* navigation *******/
|
||||
/* When the screen is less than 600 pixels wide, hide all links, except for the first one ("Home"). Show the link that contains should open and close the topnav (.icon) */
|
||||
.topnav a:not(:first-child), .dropdown .dropbtn {
|
||||
.topnav a:not(:first-child),
|
||||
.dropdown .dropbtn {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.topnav a.icon {
|
||||
float: right;
|
||||
display: block;
|
||||
@ -224,19 +242,26 @@ main
|
||||
}
|
||||
|
||||
/* The "responsive" class is added to the topnav with JavaScript when the user clicks on the icon. This class makes the topnav look good on small screens (display the links vertically instead of horizontally) */
|
||||
.topnav.responsive {position: relative;}
|
||||
.topnav.responsive {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.topnav.responsive a.icon {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.topnav.responsive a {
|
||||
float: none;
|
||||
display: block;
|
||||
text-align: left;
|
||||
}
|
||||
.topnav.responsive .dropdown {float: none;}
|
||||
.topnav.responsive .dropdown-content {position: relative;}
|
||||
|
||||
.topnav.responsive .dropdown {
|
||||
float: none;
|
||||
}
|
||||
|
||||
.topnav.responsive .dropdown .dropbtn {
|
||||
display: block;
|
||||
width: 100%;
|
||||
|
Loading…
Reference in New Issue
Block a user