@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 reasondiv
is used to wrap it's child elements to control the layout - flexbox for example). span
has the same usage asdiv
but it is for inline text style modifying. There are many other elements such asstrong, 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 withdiv
you can consider it as an article or section. - Avoid unnecessary
div
wrapping, keep your HTML simple. Becausediv
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 !! 😁😁😁😁
@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.
@haquanq
Posted
@Ruggs888 ok i am watching you 👀👀