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

NFT landing page using HTML and CSS

Pablo Cisneros•10
@Pablo6152
A solution to the NFT preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I used @media (orientation: landscape) instead of fixed pixels to show the desktop layout, I'm not sure if that's bad practice, also I think my CSS is too messy

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Sajana Wijesinghe•460
    @StormKing969
    Posted over 3 years ago

    Hi,

    Let me begin by saying congratulation for completing this challenge. As for your question about organizing your CSS file, I believe that you can do two thing (speaking from personal experience):

    • First you can section off your components with comments and basically group everything that is related together. (However, I stopped doing that because once your CSS file has more than 100 lines, it becomes hard to locate specific tags)

    The link below is an old portfolio project of mine that shows what I mean by sectioning off your file into components using comments and also the issue that I mentioned above

    https://github.com/StormKing969/Personal-Portfolio/blob/main/assets/css/styles.css

    • The second way is to learn SASS/SCSS. It's very easy to learn and you can easily link several different styling files into one. For example in your case, you could have one file to store all your variables, another to store the default values of your tags and a third one to style the card itself. This makes going back to your file and locating specific tags easy and

    The link below is an example on how I used SCSS to style my project

    https://github.com/StormKing969/Personal-Portfolio-Version-2/tree/main/scss

  • Sang Le•520
    @sqle157
    Posted over 3 years ago

    Hi,

    First of all, congratulation for completing this challenge. I think you did a pretty nice job, and I have some tips from my personal experience to help you organize your CSS.

    1. I see that you have some classes like middle, flex-type, text-accent, ... which are the utilities classes, you can group those classes into 1 comment block, like this
        .flex-type { your code }
        .middle { your code }
        .text-accent { your code }
    

    I think that will help you create a more readable and organized structure for your CSS.

    1. You can group your component CSS base on your HTML structure from top to bottom. Also, if you have any hover effect or anything for your component, try to write it right after your css for your component. For example, if you have a hover effect on your card, you can write your CSS like this
        .card { ... }
        .card:hover { ... }
    

    I recommend watching Kevin Powell and Traversy Media on Youtube. They have great content for CSS and Frontend Skills in general, and I think you will learn a lot from them!

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