Hello,
Iโve done for skill test: Structuring a page of content.
here my code on Glitch:
I changed the image path based on glitch assets.
I have a question, what should I use <article>
or <section>
?
Thanks
Hello,
Iโve done for skill test: Structuring a page of content.
here my code on Glitch:
I changed the image path based on glitch assets.
I have a question, what should I use <article>
or <section>
?
Thanks
Hi @rinaldo
Great job on this exercise. Everything is correct.
Not wrong, butI would change the formatting of the <a>
and <img>
:
<!-- before -->
<a href="image.jpg"
><img
src="image-th.jpg"
alt="description"
/></a>
<!-- after -->
<a href="image.jpg">
<img
src="image-th.jpg"
alt="description"
>
</a>
For me that looks cleaner, but itโs just a matter of taste. Your version is also correct.
In this exercise it makes sense to use <article>
like you did, because itโs a self-contained text describing the content of the web site.
In general you can ask yourself this question: โWould it still make sense when I take this text as a whole and put it somewhere else?โ If the answer is yes then you should use an <article>
. <section>
is more generic. An <article>
can contain a several chapter with their own headings and we would use <section>
for these chapters. A good example for <article>
is a blog post. You could take it and put it somewhere else (Website, news feed, print it out) and it would still make sense.
Also see the usage notes about <section>
Have a nice weekend,
Michael