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

html ,css, cards

Gerardo Castañeda•80
@osocash
A solution to the Four card feature section challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Hi, give me your feedback, I appreciate it. I had problems aligning the image of each card, I don't know what method I should use, if you have a better one, please comment

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Myles Enriquez•30
    @enriquezm
    Posted over 4 years ago

    Hey osochash great job on the conversion!

    Here's my feedback:

    • For the container .cards, I recommend you use display: grid. You'll be able to define your grid gaps and position cards easier where ever they need to be place on different breakpoints.
    • I noticed inside a card you have a div that contains the image. You can get away from that by just defining your styles on the img itself. I recommend doing this so we're not introducing nodes to the DOM that aren't needed.
    • For a card. I recommend using display: flex; flex-direction: column; Essentially, there are only 3 items in a card. Two are aligned to the left, the third (the image) is aligned to the right (using align-self: end).
  • Szymon Rojek•4,540
    @SzymonRojek
    Posted over 4 years ago

    Hi Gerardo,

    Welcome here, well done :D

    @enriquezm already mentioned important points but also I have checked your project, mainly HTML structure by the inspector in my browser and RWD => a few tips below:

    • instead of div class="texto" I'd suggest to use the header tag;
    • we can only use one the h1 tag on a page so in this project you can use the h1 and inside of it two spans: main-heading and sub-heading;
    • instead of div class="cards" you can use the main tag just to indicate the main content on a page;
    • names of the classes are not readable and descriptive so I'd recommend check the BEM naming convention;
    • you have to reset the CSS styles;
    • check a project in your browser by using the inspector on different devices => the flexbox doesn't work, cards are not growing and do not decrease according to the vwidth;
    • Important: you have used an explicit width a few times => that's not a good practice especially that you want to use the flexbox or grid. It is essential to understand well the height and width vs min-height/max-height & min-width/max-width. You shouldn’t need to give items height unless they have a background or absolutely-positioned or floated elements within them that would not normally be accounted for in the height of an element. Experienced developers use min-height and min/max-width more than anything else. It allows elements to grow and shrink;
    • try to create RWD dedicated for tablets => one column for mobiles, then two rows with two boxes each, and finally desktop design pattern;
    • try to make a project in accordance with the original design;

    Ps. Don't forget to upvote any comments on here that you find helpful.

    Greetings :D

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