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

Article preview component

Jackson-zablon15•330
@Jackson-zablon15
A solution to the Article preview component 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 using javascript to add some interactivity although it was small part but it is just the beginning.

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

I had two main challenges The first was changing the color of share svg icon when hovered. The color of share icon was dark but when hovered it changed to white according to design but i couldn't change its color, i only changed the background color.

The second was the tooltip for mobile had share icon but for desktop didn't have. How to ensure that in efficient way? I had to place them twice one outside the tooltip and another inside and on change display to none of the one inside tooltip on desktop version

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

Any constructive comments will be much appreciated

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • P
    Andrey•4,480
    @dar-ju
    Posted 5 months ago

    Hi Jackson!

    You're doing a great job!

    About the icon color.

    It's important to remember that if you connect svg via img or via background-image in CSS, you won't be able to change the icon properties.

    To be able to change the svg properties, one option is to paste the svg code directly into the html. Open the image in the browser, press ctrl+u, copy the svg code, paste it into the html, and delete the fill="..." parameter in the svg code. You can add a class to the icon like <svg class="icon" width="15" ... Then, in CSS, change the icon color as follows:

    .icon path {
    fill: #000;
    }
    

    About the share link - you did everything correctly.

    I also looked at the rest of the code:

    • it's not necessary to use the figure tag if you're not going to make captions for the images. In this case, you can just use img
    • you can't use 2 H1 tags on one page, it's an error. For the name, you can use span
    • if the page contains a date or time somewhere, you need to use the <time> tag. See how to use it correctly
    • this card should rather be wrapped in the article tag. Read here how and when to use the section and article tags

    Search engines and readers are guided by tags, so they need to be semantically correct.

    • if background images and icons (not content) are connected via img in html, then you don't need to fill alt
    • in css, try not to set a fixed height for blocks, especially the body
    • it's better to wrap the share button in an <a> tag, otherwise it's impossible to click on the button using the keyboard

    Otherwise, everything is great, good luck with your development!

    Marked as helpful
  • kunal90803•550
    @kunal90803
    Posted 5 months ago

    Great Work @Jackson-zablon15 Desktop version is looking good and perfect. But in mobile version on clicking share its position is changed accordingly to the previous position so try to keep the position of share button intact and also its seems u just overlapping it on previous part.. which is good but u must cover up the overlapped part too by increasing the height of this div.

    <div class="tooltip-container">

    Other than that u did a great job.. best of luck for future.

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