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

Four card feature section (Using Flexbox and Grid)

Jorge Muñoz•240
@jlmunozfdev
A solution to the Four card feature section challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I don't know if I have handled well the part of the margins and the padding and the theme of the Css grid. And I think I use a lot of classes when I can summarize when applying the styles.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Denis•1,060
    @Mod8124
    Posted almost 3 years ago

    Hola buen trabajo!

    El margin y el padding no te preocupes es pura practica práctica, puedes usar los figma s pero ya q no cuentas con estos puedes usar pixel perfect y puedes practicar de manera directa en css battle es mas facil por q ves los resultados de una xd

    Usaste muchas clases pero no te preocupes hay una metodología(escribir de manera eficiente el css) de css que hace lo mismo llamada bem pudiste haber ahorrado un montón de código usándola ya que usaste mucha clases que solo cambian una cosa por ejemplo

    Tu css

    
    .card__supervisor {
        display: flex;
        flex-direction: column;
        border-top: 4px solid var(--cyan);
        border-radius: 7px;
        box-shadow: 0px 10px 24px -4px rgba(0,0,0,0.5);
    }
    
    . card__team {
        display: flex;
        flex-direction: column;
        border-top: 4px solid var(--red);
        border-radius: 7px;
        box-shadow: 0px 10px 24px -4px rgba(0,0,0,0.5);
    }
    
    .card__karma {
        display: flex;
        flex-direction: column;
        border-top: 4px solid var(--orange);
        border-radius: 7px;
        box-shadow: 0px 10px 24px -4px rgba(0,0,0,0.5);
    }
    
    

    Con bem

    .card {
    display: flex;
        flex-direction: column;
        border-top: 4px solid var(--orange);
        border-radius: 7px;
    } 
    .card--supervisor {
    box-shadow: 0px 10px 24px -4px rgba(0,0,0,0.5);
    } 
    .card--team {
    box-shadow: 0px 10px 24px -4px rgba(0,0,0,0.5);
    } 
    .card--karma {
    box-shadow: 0px 10px 24px -4px rgba(0,0,0,0.5);
    } 
    

    ves es mas fácil de aplicar y ahorras un montón de código css, solo crea una clase con los valores por defecto y otra con modificaciones. En el html:

    <div class="card card--supervisor" ></div>
    <div class="card card--team" ></div>
    <div class="card card--karma" ></div>
    

    Ahora cada div tiene los mismo estilos pero cambia el shadow

    Espero te sirva, good coding 👌

    Marked as helpful
  • David•7,960
    @DavidMorgade
    Posted almost 3 years ago

    Muy buenas Jorge, excelente trabajo, se va notando todo lo que estás mejorando respecto a tus anterior proyectos, sigue así!

    Si no te importa me gustaría darte algo de feedback:

    • Lo primero y más importante, deberías de subir el valor de tus media queries, ya que si usas @media(min-width: 375px), tus estilos para mobile solo se estarían aplicando de 0 a 375px (y así no englobas apenas tamaños de telefonos), además si te fijas bien el layout se rompe desde los 375px hasta lost 700~, prueba subiendo tus media queries hasta al menos @media(min-width: 768px) que es el tamaño máximo para telefonos.

    Por lo demás muy bien, buen trabajo con el Grid, y muy buen trabajo usando align-self para alinear cada elemento por separado!

    Espero que mi feedback te sea de ayuda, si tienes alguna pregunta no dudes en preguntar! Un saludo

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

    👾Hello Jorge, congratulations for your new solution!

    Your solution seems pretty good, you've done a good work building the html structure. The first thing I saw when opened your solution was the cards box shadows. To improve your box-shadow, you’ve to have in mind two things that make a good shadow, blur and low opacity for smooth shadows. To improve your current shadow, decrease the opacity and increase the blur, try this value instead: box-shadow: 12px 7px 20px 6px rgb(57 75 84 / 8%);

    If you’re not familiar to box-shadow you can use this site to create the shadow design and then just drop the code into the CSS: https://html-css-js.com/css/generator/box-shadow/

    ✌️ I hope this helps you and 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
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