Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 1 year ago

Loopstudios landing page

alvarozama•360
@alvarozama
A solution to the Loopstudios landing page challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

I'm proud of the fact that I was able to complete this challenge using the BEM methodology and implementing it through SCSS, which made my styling much cleaner, more organized and easier to understand.

What challenges did you encounter, and how did you overcome them?

Two main challenges:

  1. Since I used the CSS background-image property to add many of the images, I was unable to really add alt attributes. To get around this, I used aria-role as "img" and aria-label as the description of the image.
  2. Again, the use of the background-image property instead of img elements made it so when I tried to add a hover state that changed the opacity of the image, it also affected the opacity of the elemet's text. I tried to get around this by using some CSS pseudo-elements, but ultimately gave up. Next time though, I will make sure tu use the proper img elements for important stuff.
What specific areas of your project would you like help with?

Acessibility. I feel like I'm still unable to get the whole aria label, labelledby, expanded, etc. right.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Krushna Sinnarkar•1,080
    @krushnasinnarkar
    Posted 12 months ago

    Hi @alvarozama,

    Congratulations on successfully completing the challenge! Your solution looks nice.

    Sure, I can help clarify the use of ARIA (Accessible Rich Internet Applications) attributes to improve the accessibility of your webpage. Here are explanations and examples for the most commonly used ARIA attributes:

    aria-label: The aria-label attribute defines a string that labels the current element. It is often used when the element itself does not have a visible label.

    <button aria-label="Close menu">✖</button>
    

    aria-labelledby: The aria-labelledby attribute identifies the element (or elements) that label the current element. It is used to reference other elements' IDs.

    <h2 id="section1">Introduction</h2>
    <div aria-labelledby="section1">
      Content labeled by the heading with id="section1" 
    </div>
    

    aria-expanded: The aria-expanded attribute indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.

    <button aria-expanded="false" aria-controls="menu" onclick="toggleMenu()">Menu</button>
    <nav id="menu" hidden>
      Menu content 
    </nav>
    

    Here, aria-expanded should be updated dynamically using JavaScript when the menu state changes:

    function toggleMenu() {
      const menuButton = document.querySelector('button[aria-controls="menu"]');
      const menu = document.getElementById('menu');
      const isExpanded = menuButton.getAttribute('aria-expanded') === 'true';
    
      menuButton.setAttribute('aria-expanded', !isExpanded);
      menu.hidden = isExpanded;
    }
    

    role: The role attribute defines the role of an element in an application. Common roles include button, navigation, dialog, and alert.

    <div role="alert">
      This is an important message.
    </div>
    

    aria-hidden: The aria-hidden attribute indicates that the element and all of its descendants are not visible or perceivable to any user as part of the accessible user interface.

    <div aria-hidden="true">
      This content will be hidden from screen readers.
    </div>
    

    Explanation:

    1. aria-label: Used for labeling elements with a descriptive text that is not visually presented (e.g., button to open the menu).
    2. aria-labelledby: Reference an ID of an element that labels the current element (not used in the example but useful for complex widgets).
    3. aria-expanded: Indicates the current state (expanded or collapsed) of a collapsible element like the menu.
    4. role: Specifies the role of elements (e.g., role="img" for non-decorative images).
    5. aria-hidden: Used to hide elements from screen readers (not used in the example but useful for decorative images or elements).

    By correctly using these ARIA attributes, your webpage becomes more accessible to users who rely on assistive technologies like screen readers.

    I hope you find this helpful, and I would greatly appreciate it if you could mark my comment as helpful if it was.

    Feel free to reach out if you have more questions or need further assistance.

    Happy coding!

    Marked as helpful

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub