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 card

Ruggs888 10

@Ruggs888

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 of seeing the project to the finish line, learning more, and learning how to manage version control along the way. It's been a blast so far and I look forward to many other projects.

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

It took me a while to figure out how to get the shadow box right for the edging of the card, but with enough tweaking and research I was able to get it accurate.

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

I am curious what is best practice when it comes to using div's and span's, I've seen people use both of them, so I would like to know in what situation would you use one or the other. For this project personally for me I chose to seperate my areas to be styled using div's and it worked out well.

Community feedback

haquanq ®️ 1,585

@haquanq

Posted

Hello @Ruggs888 👋

About div and span:

  • You can just simply understand div as a generic wrapper element with zero semantic meaning (the element you would want to choose when there are no other that fit the use case - mostly for styling reason div is used to wrap it's child elements to control the layout - flexbox for example).
  • span has the same usage as div but it is for inline text style modifying. There are many other elements such as strong, small, em,...
<p>
    This is a phrase with  <span class="make-this-bold">zero meaning</span>
</p>

About your solution:

  • Each page must have one h1 to give the page a title that tell user about it's content. Since the card have one bold and large title you can use it as a heading and wrap it like this:
<h1>
    /* you can just leave href empty, it won't redirect anywhere*/
    <a href="">HTML & CSS foundations</a>
</h1>
  • Consider using more semantic elements such as section, article, figure,.. to wrap a part of content. For example, instead of wrapping your card with div you can consider it as an article or section.
  • Avoid unnecessary div wrapping, keep your HTML simple. Because div has no semantic meaning (choose div when there is no other elements that fit the use case), you should leave the content as it is if the layout does not need special style control (like flexbox)

Happy coding !! 😁😁😁😁

1

Ruggs888 10

@Ruggs888

Posted

@haquanq Thanks for your in depth feedback I appreciate it. I will look into sections and articles more as I’ve seen them used as well. I will apply your suggested changes and update as well as I noticed that my version is a little bit smaller than the design on the compare widget.

1
haquanq ®️ 1,585

@haquanq

Posted

@Ruggs888 ok i am watching you 👀👀

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