43 Comments
User's avatar
Marta's avatar

This was a new pair of HTML tags for me, and I can see a lot of possibilities here.

https://codepen.io/idlehands1969/pen/VYvPPgq?editors=1100

Jen Kramer's avatar

You can build accordion panels with these. I know at the time I said not to use these tags for accordions... but that was 4 years ago and the industry is most definitely doing it now 🤣

Ben Weber's avatar

https://codepen.io/weberbj/pen/JjEQOeE?editors=1100

This is my response to the challenge for day 6, found it to be enjoyable.

Jen Kramer's avatar

Great work! 🎉🎉🎉🔥🔥🔥 By the way, there is no close attribute for <details>, only open.

Jen Kramer's avatar

Great work! 🎉🎉🎉🔥🔥🔥 By the way, there is no close attribute for <details>, only open.

kajal's avatar

Okay Mam👍

Jen Kramer's avatar

🔥🔥🔥🎉🎉🎉 Nicely done, great styling!

Peter Müller's avatar

https://codepen.io/pmmueller/pen/GRrwwpK

The HTML is simple and straightforward with the attribute open being the (open) secret.

In the CSS it is possible to substitute the icons used for open/close with the ::marker pseudoclass and e.g. Unicode.

Browsers that do not support ::marker here (like Safari) will show the default triangles instead, so all is fine.

Jen Kramer's avatar

Lovely job, and thanks for the ::marker tip! 🔥🎉🔥🎉🔥🎉

Peter Müller's avatar

I didn't know that before the challenge.

I knew ::marker from styling lists and found the pseudoclass in Chromes Devtools for the details/summary-triangle, so I thought "Mmh, maybe it works" - and it did.

The rest was just trial and error until it looked usable 😂

Romola Chrzanowski's avatar

Here is my challenge. I got hung up with the CSS so this is it for now: https://codepen.io/romola/pen/XWpBxqx?editors=1100

Jen Kramer's avatar

Looks fantastic! Yes, opening the panel pushes things down the page. There's no space on the page reserved for the panel when it opens (think position: relative, which would preserve space, vs. position: absolute, which does not -- or display: none which removes extra space, vs. visibility: hidden, which DOES preserve the empty space). So it will move things underneath the details panel, no matter what you do. Does that help?

Jen Kramer's avatar

🔥🎉🔥🎉🔥🎉 Looks fantastic! Nice job with the styling on the details panel. The <td> tag is used in tables, which we'll cover in days 24-26. You probably don't want to use <td> outside of a table. Great work otherwise!

Diana's avatar

Awe, thank you so much for your feedback professor Jan. I really appreciate your help. I won’t use the <td> tag then. This is so cool to learn my honest mistake while coding. :))

Jen Kramer's avatar

You're welcome! Tables are complicated - I'll try to make them easier. 😁

Diana's avatar

Sure, will do that , thank you for your feedback professor Jan.

Vanessa's avatar

https://codepen.io/vrenee26/pen/xxgXBXe

I used <details>, <summary> & <p> tags for all three entries. 'Open' attribute on the 1st <details> tag entry as well. With the 3rd entry I used the 'open' attribute in the CSS to style the changes in the appearance with the <summary> & <p> in that entry.

Jen Kramer's avatar

Woo woo! 🔥🎉🔥🎉🔥🎉 Nice job with all 3 of these plus the styling. Great work and everything looks good!

Jen Kramer's avatar

Nice job with the red and blue details panel! You forgot to close the first panel, meaning the others are hidden inside of it when it closes (oops!). Also, you might want to make the </dive> a </div> on line 34. Other than that, this looks fantastic -- great work! 🎉🔥🎉🔥🎉🔥

Jen Kramer's avatar

Nice job with the styling and the markup once again! 🔥🎉🔥🎉🔥🎉 Everything looks good -- your button-y <summary> seems to have inspired others 😁

Jen Kramer's avatar

Nifty funky styling there, Solobachi! 🎉🔥🎉🔥🎉🔥 I'm curious about the <div> in details panel 3 -- why not <p>? Excellent work and thanks for sharing!

Solobachi's avatar

I used the <div> tag because it's the same type as <p> except that they have some semantic differences which was not necessary in my code.🤔

Jen Kramer's avatar

Indeed, they are both block elements. However, <p> carries more meaning about a paragraph of information than a <div> does. <div> has no meaning by itself. It's used to group elements for styling purposes and/or hold a class/ID for styling. Still, great work!

Jade Chaffin's avatar

https://codepen.io/jarchaff/pen/BapdebL?editors=1100

I had fun messing around with the styles and transitions in this one

Jen Kramer's avatar

Ooh, pretty transitions, Jade! 🎉🔥🎉🔥🎉🔥 Code looks great. You didn't use <summary>, but there was no requirement to do so. Great work!

Jen Kramer's avatar

Well done Servane! 🔥🎉🔥🎉🔥🎉 Excellent job and pretty color choices!

Bjarne Oldrup's avatar

That's just so useful! I could see this in eg WordPress widgets where you have no access to pagebuilder elements.

https://codepen.io/oldrup/pen/dyNzgdr

Jen Kramer's avatar

I KNOW, RIGHT??? Great thing for WordPress and similar! I laughed at your comment on selectors -- you rock! Well done! 🎉🔥🎉🔥🎉🔥

Jen Kramer's avatar

🔥🎉🔥🎉🔥🎉 Well done again, Jinshuo!!! Great looking details panels 👍

K Dickenson's avatar

I was trying to get rid of the artifacts in the top corners of the detail or summary. Haven't figured that out yet.

Jen Kramer's avatar

Looks fantastic and the markup is great. Nicely done! I am not sure where that weird artifact is coming from either. Maybe you have some borders stacked? What happens if you move to the border-box model? Remember it's content-box by default unless you declare otherwise. See https://www.paulirish.com/2012/box-sizing-border-box-ftw/

User's avatar
Comment deleted
Apr 6, 2021
Comment deleted
Jen Kramer's avatar

🎉🎉🎉🔥🔥🔥 Love it! Well done, and awesome description list in there too 👍😁