body {
margin: 0;
}
* {
box-sizing: border-box;
}
img {
max-width: 100%;
display: block;
}
if you want to share the same set of columns across multiple elements, you can just define the columns in a CSS class and use that CSS class on multiple divs!
.main-grid {
display: grid;
grid-template-columns: minmax(1em, 1fr) minmax(0px, 500px) minmax(1em, 1fr);
}
order
property, and it behaves the exact same as in flexboxa library with a bunch of icons
you can get the CSS import from cdnjs.com, which hosts a bunch of libraries for easy use in a demo, e.g.
<!-- <https://cdnjs.com/libraries/font-awesome> -->
<link href="<https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/all.css>" rel="stylesheet">
and then include it in your markup like so:
<a href="#" class="social-link"><i class="fab fa-facebook-square"></i></a>
you can get this markup from the font awesome website when you search for a specific icon.
position: absolute
and set a top
and left
position: absolute
moves an item out of the flow, which means that the position of adjacent items can change tootransform: translate(X, Y);
the adjacent elements behave as if it was in its original placeposition: absolute
, the width of an element becomes the minimal width it needs for its content (it's no longer the default of 100%)position: fixed
and the item never moves, even as you scrollposition: initial
sets the position to be its original value&
and ;
→ e.g. ×
is an "X" symbol
☰
is a hamburger menu (☰)setting up the close button:
const closeButton = document.querySelector('.close-nav');
const nav = document.querySelector('.nav');
closeButton.addEventListener("click", () => {
nav.classList.remove('navigation-open');
});