Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted almost 2 years ago

Landing page HTML/JS/CSS

semantic-ui, sass/scss
CARLOS ALZATE•40
@carlosalzatep
A solution to the News homepage challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Which areas of your code are you unsure of?

Not sure about the H2 tags used for the last section titles. Neither sure about having 2 <ul><li>, one for Desktop and other for Mobile

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • P
    Jairo Valderrama•420
    @jairovg
    Posted almost 2 years ago

    Hi Carlos, congrats on your solution; here are some comments that might help you to improve it:

    Accessibility and semantics

    • Here is your heading map:
    1 - The Bright Future of Web 3.0?
    2 - New
    3 - Hydrogen VS Electric Cars
    3 - The Downsides of AI Artistry
    3 - Is VC Funding Drying Up?
    2 - Reviving Retro PCs
    2 - Top 10 Laptops of 2022
    2 - The Growth of Gaming
    
    • Even the New title has a correct hierarchy, this is the text the assistive technology will read out loud; I would consider an enhanced title with a part for screen readers only like "New articles" or "New posts".
    • The three elements of the .top-news should be h3 each of them and the section.top-news element misses its heading to enhance the assistive technologies experience. You may use a .sr-only class so it may be visually hidden.
    • The same section uses an ordered list to display its articles, however, you're using a span to enumerate the items.
    • The images in the same .top-news section are being treated as decorative images as they have an empty alt attribute. I'm wondering if they don't add any value to the related content.
    • I used to recommend the size hack you're using to override the base font size for simple calculations, but not anymore. I invite you to read this interesting blog post named Should I change the default HTML font-size to 62.5%? which explains the cons behind this hack and an approach to calculate the font-size using sass functions.

    Styles

    • It's better to use colour tokens based on their semantic use rather than their colour names. It's better for future refactors or a theme feature, in which case it's even better to use CSS variables.
    • Try to not use deep nesting in your sass rules and not to make them dependent on other elements or it will be difficult to reuse some of your components. Instead, think about them as independent components.
    • The images of the .top-news section are stretching at some breakpoints.

    Others

    • You're using two nav for the .header-nav duplicating all its children. It should be created as a single component changing its appearance using css only.

    I hope you find it useful. I'm happy to look at your solution if you make other changes.

    Marked as helpful
  • Adel•820
    @aliadelharrat
    Posted almost 2 years ago

    Congrats on completing this challenge 😍

    I typically utilize a JavaScript array to store links, which I then employ for both mobile and desktop applications, particularly when working with ReactJS.

    Happy coding 👋

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

Oops! 😬

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

Log in with GitHub