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

Article-preview-component

EDMON NASCIMENTO SANTOS•130
@Edmon-Nascimento
A solution to the Article preview component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)
Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • P
    laurice-dev•300
    @laurice-dev
    Posted 2 months ago

    You are doing great work and I am very glad to be reviewing your submission.

    #HTML Your HTML looks fantastic—well-structured and easy to review. One suggestion I’d offer is regarding your use of the <section> tag, specifically in this example: <section class="img"></section>. You might consider using a <div> or another more semantically appropriate element instead.

    The reason is that <section> is typically used for grouping related content and often includes a heading element like <h1>, <h2>, or <h3>. It’s generally intended for standalone sections of content with an intended purpose (such as a specific website component). That said, your current implementation still works—this is just a suggestion to align more closely with semantic HTML best practices.

    Reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/section

    #CSS Your CSS is clean and very easy to read. Kudos! Just a couple of small notes to share.

    I noticed your breakpoint is set around 1200px, which might be a bit early since that range still includes many desktop screen sizes (typically 1024px to 1200px). You might consider shifting the breakpoint to a slightly smaller width to better target tablet or smaller device layouts. Just a suggestion—your current setup still works well!

    Another tip: I noticed you're setting fixed widths on some elements, like in .share { width: 330px; }. While this works, it can make your layout less responsive on smaller screens. Instead, consider using max-width—this allows the element to shrink as the screen size decreases, making your design more flexible and mobile-friendly.

    #JS JS was easy to read and very clean as well.

    I kindly noticed you're using inline styles within your <div>, like this:

    <div class="share" id="share" style="display: none;">

    While this works, you might consider using CSS classes to manage visibility instead. For example, you could create .share--inactive and .share--active classes to represent the different states:

    <div class="share share--inactive" id="share"></div>

    .share--inactive {   display: none; } .share--active {   /* your visible state styles here */

    Then, in your JavaScript, you can toggle these classes using addEventListener and classList.toggle() or classList.add/remove. This approach keeps your HTML cleaner and separates structure from styling, which is a good practice in modern web development.

    Overall, you are doing wonderfully and we're all in this together! Happy to review your work and keep up the great work!

    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

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