Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 1 year ago

HTML and CSS practise

Maria Paula Palazzesi•210
@paupalazzesi
A solution to the Blog preview card challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)
Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

  • Darshan•210
    @its-subhash
    Posted over 1 year ago

    Hey @paupalazzesi , your solution looks pretty good but I just came across two major problems i would like to address, and I have some advice to how to correct those with least amount of efforts.

    1.Fixed Footer : Footer or say attribution is fixed at one place so while scrolling of even normally it comes above card, this problem can be fixed by completely removing .attribution{} class and adding flex-direction:column and gap:2rem inside body selector.

    2.Scroll Bar: It's not that of a big deal and can be ignored but in my opinion there should not be need of a scroll bar for just a card. And the best solution for it is quite headache to do when you came this far, so the easiest way I can do it is you can put margin-top:16vh insted of margin:20vh in .card class, this will add margin to the top only and it'll be centered.

    Additionally I saw lots of margins and paddings on elements which isn't that good thing, so you can explore it's better alternative, like explore flex and grid little more.

    Rest of the code was really good, I hope you'll find this helpful.

    Marked as helpful
  • Marcos Travaglini•6,210
    @Blackpachamame
    Posted over 1 year ago

    ¡Saludos Maria Paula! has hecho un buen trabajo 😃

    📌 Te dejo algunas sugerencias

    • Para mejorar la semántica de tu HTML, podes cambiar tu <div class="card"> por <main class="card"> y <div class="attribution"> por <footer class="attribution">
    • Podes usar display: block en tu img para quitar el espacio en blanco por debajo de la imagen. Aunque en este caso es visualmente irrelevante, pero puede ayudarte a calcular mejor los espacios entre un elemento y otro
    • El texto Learning no es un button si no mas bien podría ser un enlace a, ya que, al darle click te llevaría a otra página. Los botones se usan para funcionalidades como enviar un formulario o cambiar el tema del sitio
    • Los encabezados h1, h2, etc, deben ir en orden del mayor al menor. En este caso tu h2 podría ser tranquilamente un p
    • Como dijo el compañero en el otro comentario, no recomendaría usar position: fixed para este footer, si lo notas, en algunas pantallas llega a superponerse con la card y es algo molesto. En su lugar, podes seguir la recomendación que te dejaron de usar flex-direction: column en el body, para que se vea correctamente tenes que quitar el position: fixed del footer y los margin en el card y dejar tu body de la siguiente manera:
    body {
        background: var(--yellow);
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        gap: 2rem; /* Esto genera un espacio entre el main y el footer */
        min-height: 100vh;
        margin: 0; /* Esto quita los márgenes que vienen por defecto en los navegadores en el body, podrías aplicarlo directamente como parte del reset en tu selector universal (*) */
    }
    

    Espero que estas sugerencias te ayuden a mejorar 🤓

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 1st-party linked stylesheets, and styles within <style> tags.

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.

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