Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liuxiaomingskm/7b83a0d6ec0f293d58762d515d159102 to your computer and use it in GitHub Desktop.
Save liuxiaomingskm/7b83a0d6ec0f293d58762d515d159102 to your computer and use it in GitHub Desktop.
Dead Simple Flexbox Nav(响应式navbar)
<nav>
<a href=""><i class="fa fa-home"></i>Home</a>
<a href=""><i class="fa fa-question"></i>About</a>
<a href=""><i class="fa fa-phone"></i>Contact</a>
<a href=""><i class="fa fa-paw"></i>Dogs</a>
</nav>
@import url(https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css);
@import url('https://fonts.googleapis.com/css?family=Raleway:200');
nav {
display: flex;
flex-direction:row;
justify-content:flex-end;
}
a {
font-size:40px;
margin:20px;
text-decoration:none;
color:#95a5a6;
font-family: raleway;
border-bottom: 1px solid #52c9aa;
transition: color 3.55s ease-out;
}
a:hover {
color:#3498db;
border-bottom-color:#3498db;
}
i{
margin-right:10px;
}
@media screen and (max-width:920px){
nav {
justify-content: space-around;
}
a {
font-size:26px;
}
}
@media screen and (max-width: 600px){
nav{
display:flex;
flex-direction:column;
align-items: center;
background: #34495e;
}
a{
color:white;
}
}
@liuxiaomingskm
Copy link
Author

练习了响应式网页的做法 特别是@media screen and 的用法~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment