

We’re going to approach our CSS progressively too, so using principles of CUBE CSS: we’re going to start right at the top with some global CSS. We know now that as long as this very small HTML page lands in the user’s browser, they can immediately and effectively use it. The key to progressive enhancement is building up with a principle of least power approach. We’ve got all of our HTML now and guess what: we’ve got a fully functional web page (if you ignore the # links). We’ve got an id of main-content on there, too, which is what our skip link links to. The only bit to make you aware of is that the element should only feature once on the page, being the main content. There’s not much to say about this as it’s a pretty straightforward. This whole page is what you’re building in the tutorial 👆. In this premium tutorial, we’re going to build a burger menu from the ground up, using progressiveĮnhancement, `ResizeObserver`, `Proxy` state and of course, super-solid HTML and CSS Preserving often-limited horizontal space, but they also, more often than not, areīuilt in a user-hostile, non-accessible fashion. Them is, they continue to be a dominant design pattern. Still inside index.html, add the following after the closing :Ī responsive, progressively enhanced burger menuīurger menus are a relic of responsive design that no matter what your opinion of Let’s wrap up our HTML by adding the last bit. It’s not required in our case, but if you have more than one on a page, you must label them to help assistive technology. This capability helps us build this project progressively, which we’ll get into more, shortly. This is a great example of HTML being an incredibly smart programming language because even though we’ve not defined what this element is or does yet, but the browser doesn’t care-it just continues doing what it’s doing, without any fuss. It’s wrapped in a element which is a Custom Element. Lastly, we have our main navigation-a classic unordered list of links in a element. Very importantly, the alt on the image describes the image as “ACME logo”, with “ACME” being the name of the company.

We’re using the aria-label attribute to provide the text to mainly assist screen readers. Next up, we have the brand element, which contains our placeholder logo.

It’ll be visually invisible by default and show on focus, when we get around to writing some CSS. A skip link allows a user to skip past the header and navigation and jump straight to the element-which in our case-contains a simple. This is our main site header and it’s got a few bits that we’ll break down. Open up index.html again, and after the opening tag, add the following: We’re using this modern CSS reset to give us some sensible defaults that we’ll build on with our custom CSS. This is our HTML shell and features all the relevant CSS, fonts and JavaScript files, pre-linked and ready to go. Build a fully-responsive, progressively enhanced burger menu
