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

Responsive product-preview-card

Baran Yeşilaltun•30
@baranyesilaltun
A solution to the Product preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I dont understand why is the css didnt work on live .

Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

  • Philip Korb•170
    @PhilipKorb
    Posted almost 3 years ago

    I saw your code on github and your path to resources are not matching.

    in your project case: • main folder • index.html • styles.css • images folder

    that means you have to respect the path of each resource.

    your code:

    <link rel="stylesheet" href="/styles.css"> <img src="/images/image-product-mobile.jpg" alt="" class="chanel">

    in both resources you have a slash starting, which are interrupting the path.

    Try this:

    <link rel="stylesheet" href="styles.css"> <img src="images/image-product-mobile.jpg" alt="" class="chanel">
    Marked as helpful
  • Paweł Bojemski•170
    @Spirit-
    Posted almost 3 years ago

    The mistake with not working CSS is using wrong path used in link element.

    Path for CSS you provided is absolute /styles.css. The slash (/) at the begining of the path means "go to the root directory and follow with path" and will produce path example.com/styles.css.

    Because you are using GitHub pages to deploy you must remember that your page will be in subdirectory. You can skip the starting slash and leave just styles.css - the path generated will be example.com/deployed-repository/styles.css.

    I loaded your file correctly by my side and I can tell you are going to need the same for images.

    Anyways, congratulations on your solution!

    It looks nice in mobile version, however there is no desktop one?

    Marked as helpful
  • Lucas 👾•104,160
    @correlucas
    Posted almost 3 years ago

    Hello Baran, congratulations for your solution!

    Your CSS sheet is not working online because you did not declare the file path.

    Note that local you don't need to put../ to indicate the folder location, but online yes.

    Só remember ./ dot slash for the same folder and .. / for a sub folder.

    See the correct import below

      <link rel="stylesheet" href=". /styles.css">

    Hope it helps, 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

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