Build a Lightbox Viewer - Build a Lightbox Viewer

Tell us what’s happening:

I’m not having any issues, just a question. Why do we have to use a div to show the image picked and display it, we did learn like a couple of lessons back about the dialog element and how to use it. Won’t it be better to use it here instead of a div?

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36

Challenge Information:

Build a Lightbox Viewer - Build a Lightbox Viewer

Interesting question. I think div is more appropriate for this application because it has no semantic meaning and we’re using it only for display purposes. (a dialog usually has at least one button to do some action on it like to close it, but that’s not the case here)

but here, we also a have a button to close it.

oh yes, I didn’t remember that. It would make sense to use a dialog in that case. (But note, this doesn’t mean that this exercise should change, as it is just an exercise after all)

Hi @GhadyKeyrouz ,

I was trying to edit your post to blur your code and change the category to Code Feedback, but I messed up the “blur code” bit and now it just looks wonky. So, I’m going to let you do it. :slight_smile:

Please wrap your code in [spoiler][/spoiler] tags.

Sorry about the blooper. :zany_face:

the code has not been indented I think so it is hard to read as-is

I deleted it, I couldn’t edit it for some reason

yeah idk why it does that when I copy and paste code here, it doesn’t show any indentation, I could send the link to the codepen which contains the code