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

HTML & CSS Foundations

accessibility
Harsha Surwase•50
@Haruu4304
A solution to the Blog preview card 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

  • Mihai Chirilov•140
    @MihaiChirilov
    Posted over 1 year ago

    The most challenging part will be to setup the card shadow to increase from 8px to 16px when you mouse hover the title of the blog. You can find a solution online. Here is a good example for a solution which you can implement for your blog card: https://stackoverflow.com/questions/8114657/how-to-style-the-parent-element-when-hovering-a-child-element The hover effect on the title is easy to setup, simply add the :hover and change the colour to yellow.

    You can slightly adjust the spacing, especially on the bottom part. But the most important thing is that you have started working on a solution which can be improved and refined until you are satisfied with it. Even if it is a very simple example, it teaches you many things about best practices. And with each new challenge you will improve and all the knowledge will build on top of the previous one.

    Good job and keep working on these challenges! Thank you, Michael

  • Mihai Chirilov•140
    @MihaiChirilov
    Posted over 1 year ago
    • .card-container should have its black border set to 1px;
    • I would also centre the blog card vertically and horizontally using either:
      • display: flex;
      • display: grid; Each one has additional settings to centre the blog card. Currently if you resize the browser to a smaller width, you will see how your approach is not being responsive. So the easiest way to solve this is by using either flex or grid for the display.
    • I would remove the width of 16% from the class .image-greg img and add the dimensions directly to the <img> tag as attributes: width="32" height="32". This is how the image is sized in the design file.
    • for "Learning" category, I would remove the enclosing <div> and just use <p> or <h2> tag which can be directly styled with CSS by adding a class to it. It is much easier and more predictable to style an element rather than an element inside a div.
  • Mihai Chirilov•140
    @MihaiChirilov
    Posted over 1 year ago

    Hello Harsha, Good job on submitting this solution for this challenge. It is important that you have started this journey as a frontend developer. There is a lot to learn in this field. I have a couple of suggestions for you to improve your solution and to get as close as possible to the original design.

    <img src="./assets/images/illustration-article.svg"> requires an alt attribute describing what the image is. It is necessary for accessibility.

    • In my opinion you have overused the <div> element. Your HTML structure is made up of lots of divs and inside them you are using <img> and <p> tags. Maybe you need a quick refresh on the recommended HTML structure. I would suggest to simplify your HTML structure like this:
    <main> <img /> <h2>Learning</h2> <p>Published 21 Dec 2023</p> <h1>HTML & CSS foundations</h1> <p>These languages are the backbone of every website, defining structure, content, and presentation.</p> <div> <img /> <h3>Greg Hooper</h3> </div> </main>

    Of course you need to add CSS classes to the structure above in order to style it.

    • you need to add :hover state for the title of the blog ("HTML & CSS foundations") so that when you mouse over it, it changes the colour to yellow and also the dropshadow of the container increases. This part was the most challenging for me when I have completed this one.

    Thank you, Michael

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

Oops! 😬

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

Log in with GitHub