Skip to content

Instantly share code, notes, and snippets.

@semiarthanoian
Created April 25, 2022 14:29
Show Gist options
  • Save semiarthanoian/08ba7c44f14afa088c74d0b8f1f26e6f to your computer and use it in GitHub Desktop.
Save semiarthanoian/08ba7c44f14afa088c74d0b8f1f26e6f to your computer and use it in GitHub Desktop.
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
* Reseting CSS
*/
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
* Styling navigation bar for large screen devices
*/
.navbar {
position: relative;
background: Black;
}
.navbar-left {
display: inline-block;
margin-left: 15px;
}
.navbar-right {
display: inline-block;
margin-right: 15px;
position: absolute;
top: 0;
right: 0;
}
.navbar-brand,
.navbar .nav-link {
color: White;
text-decoration: none;
display: inline-block;
padding: 15px;
}
.navbar-brand {
font-weight: bold;
padding-left: 30px;
padding-right: 30px;
background: RoyalBlue;
}
.navbar .nav-link:hover {
color: LightGray;
}
.navbar-collapse,
.navbar-toggler {
display: none;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
* Override styles to support mobile devices
*/
@media (max-width: 842px) {
.navbar-right,
.navbar-left {
display: block;
border-top: 1px solid DimGray;
}
.navbar-right {
position: static;
}
.navbar .nav-link {
display: block;
}
.navbar-collapse:checked + .navbar {
max-height: 50px;
overflow: hidden;
}
.navbar-toggler {
color: White;
display: inline-block;
padding: 15px 25px;
position: absolute;
top: 0;
right: 0;
border-left: 1px solid DimGray;
cursor: pointer;
}
} /* @media */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment