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

Responsive News Homepage using HTML,CSS and JavaScript

Shoaib Shuja•590
@ShoaibShuja
A solution to the News homepage 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?

The Layout was a bit confusing, but CSS's flexbox did the trick.

What specific areas of your project would you like help with?

Any feedback would be appreciated.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Vatukah•190
    @Vatukah
    Posted 12 months ago

    ✋Hey ShoaibShuja,

    I just wanted to give you a huge shout-out for completing your latest Frontend Mentor challenge! 🎉.


    It's clear that you've put a lot of effort into this project, and the results speak for themselves.


    As someone who also tackles these challenges, I know how much effort it takes to get everything just right


    But,


    as coder i want tell you some tips that will help in further developing journey:


    CSS


    1. Minimize Repetitive Code:

    Reduce repetition by using common classes or mixins for similar styles. css

    .flex-center {
      display: flex;
      justify-content: center;
      align-items: center;
    }
    
    .news__header-navbar,
    .news__content,
    .news__content-article,
    .news__content-left,
    .news__content-right,
    .other__box {
      @apply .flex-center;
    }
    

    2 Responsive Design Improvements:

    • Ensure all elements adjust well to different screen sizes. Test the layout on various devices and screen sizes to ensure it looks good everywhere.

    • Consider using CSS Grid for complex layouts to take advantage of its powerful features for creating responsive designs.

    3 Font Size and Line Height

    • Use relative units for font sizes and line heights to enhance accessibility and scalability.
    body {
      font-size: 1rem; /* 16px */
      line-height: 1.5;
    }
    
    .news__content-article h1 {
      font-size: 2rem; /* 32px */
    }
    
    .news__content-article_text p,
    .next__news p {
      font-size: 0.9375rem; /* 15px */
    }
    

    3 Transition Properties:

    • Ensure transitions are smooth and specify which properties should transition to avoid unnecessary computations.
    .news__header-navbar {
      transition: transform 0.5s ease;
    }
    
    • your code

    .news__header-navbar {
        transform: translateX(100%);
         
        position: fixed;
        top: 0;
        left: 30%;
        width: 100%;
        min-height: 100vh;
        flex-direction: column;
        padding: 8rem 2rem;
        align-items: flex-start;
        justify-content: flex-start;
        background: var(--color-off-white);
    
        transition: 0.5s ease;    // here
      }
    

    ** HTML**


    • use of semantic html .Click here to know more about Semantic Html.

    Overall your code is good✨.


    Keep it up and do code daily to be best programmer😎. By applying and addressing above tips you can be better

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 1st-party linked stylesheets, and styles within <style> tags.

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.

Oops! 😬

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

Log in with GitHub