This was my first time creating a burger style menu. I am unsure of the method I used for greying out the page when the menu is visible - is there a way to grey out the entire page (i.e if the page is scrolled down) beyond the visible area?
exitsimulation
@exitsimulationAll comments
- @potato58Submitted almost 2 years ago@exitsimulationPosted almost 2 years ago
I think your method is perfectly fine. Since it's a
<div>
that's positioned withabsolute
and scaled to the full page dimensions you won't need to worry about it scrolling past the visible area. I will always cover the full viewport. For the mobile version of this challenge I created a top bar that issticky
, so that users would have access to the burger menu from anywhere on the page. Maybe it's worth a considerationMarked as helpful1 - @EduardIonescuSubmitted almost 2 years ago
On my last challenge I got advice to use rem instead of px, but should I do that for everything, or should some things be in px (font-size / width etc) ?
@exitsimulationPosted almost 2 years agoThere are several advantages to using the rem unit over the
px
unit in CSS. First, therem
unit is relative, which means that it scales based on the root element of the document, whereas thepx
unit is an absolute unit of measurement that does not scale. This makes therem
unit more flexible and easier to work with, especially when creating responsive designs that need to look good on a variety of different screen sizes.Another advantage of using the
rem
unit is that it makes it easier to create consistent sizing across different elements on a page. Because therem
unit is based on the root element, you can use it to size elements relative to the base font size, which is specified on the<html>
element. This makes it easy to ensure that all text on a page is consistently sized, regardless of where it appears in the document hierarchy.Additionally, using the
rem
unit can make your CSS code easier to read and maintain. Because the rem unit is a relative unit of measurement, it can make your CSS code more self-contained and easier to understand. This can be especially helpful when working on large, complex stylesheets with many different elements and styles.Overall, the
rem
unit offers a number of advantages over thepx
unit, including greater flexibility, consistency, and readability in your CSS code.1