Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Blog preview page with CSS box model and flexbox

NeonCodes 20

@NeonCodes

Desktop design screenshot for the Blog preview card coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are you most proud of, and what would you do differently next time?

I am proud that the final result looks close to the image preview. It was also another opportunity to continue practicing flexbox and try hover and focus states. Next time, I hope I will code faster and make less research.

What challenges did you encounter, and how did you overcome them?

-Styling the two images: put each image in a div image 1 and 2 : at first, the first image didn t have round corners despite applying border-radius ; putting it directly in img{} fixed that at first ; Then, adding padding to image erased border-radius again. = adding padding to card instead of image fixed that.

-The yellow background kept getting inside the card: I changed yellow background to html {} instead of inside *

-  Sometimes, It was easy to get lost in all the divs and containers. I had to review my code and the indents multiple times to make sure everything was okay.

-The second image doesn’t keep its size inside the div:did styling on the head instead of the css stylesheet to fix that.

What specific areas of your project would you like help with?

I need help positioning authorname correctly: It was positioned fine on a previous version then, I changed the font and couldn't get the same result. I can't find it in the repository either. Also, general feedback on the code itself is welcome: organization, unnecessary lines, things that could have been done more easily etc

Community feedback

@TedJenkler

Posted

Hi @NeonCodes,

Nice project! Here are a few suggestions:

For this project, an ideal structure would be to use <main> and <footer>. Set <main> as a flex container with flex-direction: column so that all elements stack on top of each other. This will help you remove unnecessary <div>s and incorrect semantics, such as <header>.

Consider this analogy for HTML and CSS: imagine HTML as Lego bricks and CSS as the color you apply to those bricks. Instead of changing the color by altering the brick itself, choose the right brick and then apply the appropriate color. It might sound like a silly analogy, but it can be helpful. The <h1> tag should be reserved for the most important content, like the page title. For this project, <h1> is not needed. Instead, use <h2> for main headings, and within <h2>, use <h3>, and so on, with <h4> for sub-sub-headings. This approach will greatly improve accessibility, SEO, and overall readability.

Keep up the great work!

Best, Teodor

Marked as helpful

0

NeonCodes 20

@NeonCodes

Posted

@TedJenkler Hello, Thank you for the feedback! -So main would be the "card" for instance? -This analogy helps make it easier to understand: since I started rereading about landmarks and learn about accessibility it seemed a bit tricky at first.

Best as well!

1
Yassine 50

@xYAssixx

Posted

  • The solution includes semantic HTML , and that is a good start.
  • The code is not accessible because it needs reordering semantic HTML5 elements
  • There are some improvements that can be made:
  1. you don't need to use img elements inside div , only if you need to use pseudo elements like before
  2. to fix author section you just have to set author to flex box with no specific width
  3. you need to reorder semantic HTML , so that all elements are inside the body element. :
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Sample Semantic HTML Page</title>
</head>
<body>

    <header>
        <h1>Website Title</h1>
        <p>Welcome to our website</p>
    </header>

    <section>
        <article>
            <h2>Article Title</h2>
            <p>This is a sample article about something interesting.</p>
        </article>
    </section>

    <footer>
        <p>© 2024 Website Name. All Rights Reserved.</p>
    </footer>

</body>
</html>

Marked as helpful

0

NeonCodes 20

@NeonCodes

Posted

@xYAssixx Thank you for the feedback and the code sample! I'll try doing that

0

Please log in to post a comment

Log in with GitHub
Discord logo

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