Fix nav on destop
This commit is contained in:
@ -2,6 +2,7 @@ body{
|
|||||||
min-width: 100%;
|
min-width: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: row wrap;
|
flex-flow: row wrap;
|
||||||
@ -85,6 +86,7 @@ nav{
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
|
|
||||||
.topnav {
|
.topnav {
|
||||||
background-color: #333;
|
background-color: #333;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@ -149,7 +151,8 @@ nav{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Add a dark background on topnav links and the dropdown button on hover */
|
/* 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;
|
background-color: #555;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
@ -165,14 +168,25 @@ nav{
|
|||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
main
|
main {
|
||||||
{
|
|
||||||
background-color: #eeeeee;
|
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 */
|
/* Medium screens */
|
||||||
@media all and (max-width: 600px) {
|
@media all and (max-width: 600px) {
|
||||||
|
|
||||||
/******* header *******/
|
/******* header *******/
|
||||||
#header {
|
#header {
|
||||||
/* When on medium sized screens, we center it by evenly distributing empty space around items */
|
/* When on medium sized screens, we center it by evenly distributing empty space around items */
|
||||||
@ -195,11 +209,13 @@ main
|
|||||||
|
|
||||||
/* Small screens */
|
/* Small screens */
|
||||||
@media all and (max-width: 500px) {
|
@media all and (max-width: 500px) {
|
||||||
|
|
||||||
/******* header *******/
|
/******* header *******/
|
||||||
#header {
|
#header {
|
||||||
/* On small screens, we are no longer using row direction but column */
|
/* On small screens, we are no longer using row direction but column */
|
||||||
flex-flow: column wrap;
|
flex-flow: column wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
#header .flex-item {
|
#header .flex-item {
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
margin: 2px;
|
margin: 2px;
|
||||||
@ -210,9 +226,11 @@ main
|
|||||||
|
|
||||||
/******* navigation *******/
|
/******* 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) */
|
/* 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;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.topnav a.icon {
|
.topnav a.icon {
|
||||||
float: right;
|
float: right;
|
||||||
display: block;
|
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) */
|
/* 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 {
|
.topnav.responsive a.icon {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.topnav.responsive a {
|
.topnav.responsive a {
|
||||||
float: none;
|
float: none;
|
||||||
display: block;
|
display: block;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
.topnav.responsive .dropdown {float: none;}
|
|
||||||
.topnav.responsive .dropdown-content {position: relative;}
|
.topnav.responsive .dropdown {
|
||||||
|
float: none;
|
||||||
|
}
|
||||||
|
|
||||||
.topnav.responsive .dropdown .dropbtn {
|
.topnav.responsive .dropdown .dropbtn {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
Reference in New Issue
Block a user