Skip to content

Instantly share code, notes, and snippets.

@luisfergromo
Created July 12, 2020 21:54
Show Gist options
  • Select an option

  • Save luisfergromo/722778403f9356666b5015ef1e8fa22a to your computer and use it in GitHub Desktop.

Select an option

Save luisfergromo/722778403f9356666b5015ef1e8fa22a to your computer and use it in GitHub Desktop.
qBbyaQg
<div id="root"></div>
ReactDOM.render(
<section>
<nav>
<ul>
<li id="home" class="item-nav">
<a href="#home">Home</a>
</li>
<li id="about" class="item-nav"><a href="#<about">About</a></li>
</ul>
</nav>
</section>,
document.getElementById("root")
);
<script src="https://unpkg.com/react/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom/umd/react-dom.development.js"></script>
* {
padding: 0;
margin: 0;
}
a {
text-decoration: none;
color: black;
}
.welcome {
width: 100%;
height: 100vh;
align-content: center;
display: flex;
}
#home {
display: flex;
top: 0;
left: 0;
position: fixed;
width: 100%;
z-index: 10;
justify-content: flex-start;
}
#about {
display: flex;
top: 0;
left: -40px;
position: fixed;
width: 100%;
z-index: 10;
justify-content: flex-end;
}
nav {
height: 40px;
background-color: graytext;
}
nav ul {
list-style: none;
}
.item-nav {
display: inline;
padding: 1rem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment