This is a solution to the News homepage challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout for the interface depending on their device's screen size
- See hover and focus states for all interactive elements on the page
- Live Site URL: https://tjrelly.github.io/news-homepage/
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
To see how you can add code snippets, see below:
.show-menu .nav {
background: hsla(240, 100%, 5%, 0.3);
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: flex-end;
width: 100%;
height: 100%;
position: absolute;
top: 0;
right: 0;
}
const menuBtn = Array.from(document.querySelectorAll(".menu-btn"));
const header = document.querySelector("header");
const nav = document.querySelector(".nav ul")
for (btn in menuBtn) {
menuBtn[btn].onclick = toggleMenu;
}
function toggleMenu() {
header.classList.toggle("show-menu");
nav.classList.toggle("active")
}
- Website - Terrell Jackson
- Frontend Mentor - @TJRelly
- Twitter - @TJR_Tech