How To Make Collapsible Using HTML CSS Only | No Javascript

Поделиться
HTML-код
  • Опубликовано: 25 окт 2024

Комментарии • 119

  • @lundeveloper
    @lundeveloper  6 месяцев назад +15

    What a surprise. With this function, no need to use javascript, everything will become simple. Don't forget to subscribe to the channel to watch more interesting videos about web developers ❣

    • @zohaibkhatak1464
      @zohaibkhatak1464 3 месяца назад

      Please make video on responsive nav bar but this should be really complex nav bar like it should have a lot of drop down. Then make it responsive for Mobile.

    • @LucasMaieskiMarques
      @LucasMaieskiMarques 2 месяца назад

      What if we have this component inside a modal and this modal have a width/height limit with overflow:hidden?
      when the menu is opened the content is cut.
      How can we handle this scenario?
      In React/Nextjs we have createPortal and its a valid choice but what if were using just HTML, CSS and JS?

  • @mikda360
    @mikda360 3 месяца назад +18

    Thanks for shouting the instructions at me. It was helpful in that it overpowered the unnecessarily loud keyboard sound. Top notch ❤

  • @gibber1sh-c6w
    @gibber1sh-c6w 6 месяцев назад +3

    This is brilliant. Both the project and how you presented it. Great job!

  • @dcernach
    @dcernach 20 дней назад +1

    Glad to Know it ! Thanks ! I'm gonna put it in use right now!

  • @ismailcreatvt
    @ismailcreatvt 6 месяцев назад +11

    Amazing! I knew about the details tag. But I thought of it as an old and ugly version of an accordion. Never thought of using it this way! Great content. 👍

    • @lundeveloper
      @lundeveloper  6 месяцев назад +3

      Thank you so much 😍 Yes, There are many people who know about this html tag but can't think of how to use it 😍

  • @martapfahl940
    @martapfahl940 4 месяца назад +19

    For the people asking why should we do this without JS if we have JS. It is always best to ship the least amount of JS possible to the client (browser) to enhance speed and performance.

    • @balex259
      @balex259 3 месяца назад +1

      Yeah, few lines of js will slow a website… we are in 2024, you can build fast and more responsible with js…

    • @martapfahl940
      @martapfahl940 3 месяца назад

      @@balex259 So you dont care about the people with a slower internet connection or weaker systems? And what about people having open tons and tons of applications all unoptimzed? I am running 16GB on my machine at work and having open a dozen different JS Applications together with Docker is fucking up my RAM dude.

    • @guillermomazzari8320
      @guillermomazzari8320 2 месяца назад

      Or if you use blazor, like me, it is awesome

    • @borstenpinsel
      @borstenpinsel Месяц назад +1

      As long as browsers implement stuff like that differently and at a different pace, js will always have it's place even for native stuff.
      I come from the same mindset. Use as litte js as possible. But if one can do this (or anything) now with jQuery and it works on IE6 and Opera Mini. Why would one use a native solution that only works in chrome and Firefox (but looks weird in Firefox) and will be supported by Safari in 2025 and breaks the entire page on the few but existing computers with older OS/browsers.

  • @Pharmtechie
    @Pharmtechie 4 месяца назад +1

    This guy is not from planet earth, You are so great, Your presentation is Top-notch.

  • @kaspiemeharaj7818
    @kaspiemeharaj7818 3 месяца назад

    Thanks for shouting the instructions at me. It was helpful in that it overpowered the unnecessarily loud keyboard sound. Top-notch❤❤

  • @heidardotdev
    @heidardotdev 3 месяца назад +1

    great tutorial please continue we'll support your with positive comments

    • @lundeveloper
      @lundeveloper  3 месяца назад +1

      Thank you brother 😍😍

    • @heidardotdev
      @heidardotdev 3 месяца назад +1

      @@lundeveloper you are most welcome my smart and creative friend

  • @GlennPhilp
    @GlennPhilp 4 месяца назад +1

    Great proof-of-concept, I would ensure that AI is making accessible examples. The most basic is ensuring either a screen reader name is used with using icons or at least aria-label.

  • @iboy35
    @iboy35 3 месяца назад +2

    There's more to life than Chrome!
    @5:22 : for webkit browser use : summary::-webkit-details-marker { display: none }

  • @KhunAungHtunLay
    @KhunAungHtunLay 2 месяца назад

    my react project doesn't need too much on off state, thanks for this content

  • @tm2cruz
    @tm2cruz 3 месяца назад +2

    Thanks for this, I've been doing html since I was in around 90's or early 2000's (cant remember the exact year) and I didnt know or maybe realized about the "details" command

    • @aCatSiki
      @aCatSiki 3 месяца назад

      TIL html commands = tags

  • @alirezamousavi3583
    @alirezamousavi3583 24 дня назад

    You are amazing. Thanks for the tip

  • @codeWithAslam
    @codeWithAslam 23 дня назад

    There's no need to change voice ai. it's perfect 👌

  • @nayanbiswas370
    @nayanbiswas370 3 месяца назад

    Ow i never knew about it, thank you lundev, we want more cool topics 🥰

  • @sakifhoossain2465
    @sakifhoossain2465 3 месяца назад

    Finally, there's someone who can who can actually teach us the art of css and js of real life scenarios.... ❤❤❤❤❤

    • @lundeveloper
      @lundeveloper  3 месяца назад

      Thanks, I will do more ❤

    • @sakifhoossain2465
      @sakifhoossain2465 3 месяца назад

      @@lundeveloper love you man. 😍 Just keep it up 💪💯

  • @RonnieMbugua
    @RonnieMbugua 2 месяца назад

    Love that voice, keep doing the great work

  • @giannistourkos
    @giannistourkos Месяц назад

    Excellent job!!!

  • @danimatuko
    @danimatuko 4 месяца назад +3

    Effortlessly explained but yet so good. This channel is going to blow up very soon!

  • @AdamAwad-vf4sx
    @AdamAwad-vf4sx 3 месяца назад

    As a css beginner doesn't know a letter in js all i see is a masterpiece of art🏆

  • @AlThePal78
    @AlThePal78 3 месяца назад

    I am glad I saw this because I never knew that about the details and it works like a ui with no display-style nice

  • @okforcoding
    @okforcoding 23 дня назад

    ohhh goood idea thanks bro

  • @eliamzg
    @eliamzg 4 месяца назад

    Pretty clever, great presentation as well

  • @ThomasHnrt
    @ThomasHnrt 2 месяца назад

    Amazing ? Nah.
    Popover API and anchor positionning are amazing ! ❤

  • @younesdeveloper
    @younesdeveloper 20 дней назад

    great content for the 4th time

  • @JonasMORACHABI
    @JonasMORACHABI 6 месяцев назад

    AMAZING. Thancks you for this content

  • @MahdiTaghiyan-g6z
    @MahdiTaghiyan-g6z 3 месяца назад

    This is Awesome Bro Thank You

  • @flexpixels
    @flexpixels Месяц назад

    First of all, great video, thanks for sharing! I would like to know how you will approach the menu animation, what if we need to animate the menu on open and close? Also what if we want to close the menu once one of the items inside is clicked or the user clicks outside of the menu not on the toggle button.

  • @yousefmohsen25
    @yousefmohsen25 2 месяца назад

    Thanx man you are legend ❤

  • @ZyncInteractive
    @ZyncInteractive 3 месяца назад +1

    Did you ElevenLabs Mr Beast as your narrator? haha good stuff

  • @Johnathan_.
    @Johnathan_. 6 месяцев назад

    Expecting more of these no js tricks!! ❤❤❤❤❤

  • @HarshDoes
    @HarshDoes 5 месяцев назад

    Amazing video. Bring more of this🙌

  • @_u_nknownuser
    @_u_nknownuser 2 месяца назад

    lemme go try yr videos to start from the basics.

  • @kazz97
    @kazz97 6 месяцев назад +7

    Lmao you must be using MrBeast AI voiceover

  • @nitinsoni3123
    @nitinsoni3123 2 месяца назад +1

    This is the good approach but it fails when we want to close the dropdown on outside click.

  • @SogMosee
    @SogMosee 3 месяца назад

    Should have animated display on open and close. Also popover api is better for the last reason you mentioned in that it does the auto positioning for you based on available space. Might even be able to combine with these elements since popover is just an attribute

  • @tiagoae
    @tiagoae 5 дней назад

    amazing!!

  • @daldreams
    @daldreams 2 месяца назад

    SOO COOL!!! Question: is there an easy way to hide the buttons/items in the list when someone clicks anywhere else on the page?

  • @zohaibkhatak1464
    @zohaibkhatak1464 3 месяца назад +1

    Please make video on responsive nav bar but this should be really complex nav bar like it should have a lot of drop down. Then make it responsive for Mobile.

  • @hexagon0904
    @hexagon0904 Месяц назад

    Thank you for your sharing. I wonder how to manage the menu position from bottom to top with cards which at the bottom of the screen?

  • @CodeXNinja
    @CodeXNinja 6 месяцев назад

    That's brilliant ❤❤..

  • @Patrik38cz
    @Patrik38cz 3 месяца назад +1

    How would you go about Animations for opening/closing?

  • @developermsmahadi
    @developermsmahadi 3 месяца назад

    Thank you so much 🎉❤

  • @robertostringa9254
    @robertostringa9254 3 месяца назад

    Great !!

  • @juanalbertoboada
    @juanalbertoboada Месяц назад

    Jaw dropper video!
    Is it possible to close an open collapsible when click on a different one just using css?

  • @ArunKumar_237
    @ArunKumar_237 4 месяца назад

    Sir please suggest best tutorials to learn advance css it will be very much helpful for us

  • @RadiusRadiated
    @RadiusRadiated Месяц назад

    you should do a vs studio setup/settings video

  • @sibghatkhan9678
    @sibghatkhan9678 12 дней назад

    what about outside click ? Does it close when we click outside of the dropdown

  • @simonkalu
    @simonkalu 2 месяца назад

    You rock!

  • @iTzBoosTerZx
    @iTzBoosTerZx 3 месяца назад

    you can just set box2 to whatever it is not on click, no need for the if statement

  • @funnyariyo5763
    @funnyariyo5763 3 месяца назад

    I remember I once used it for an FAQ section

    • @robinheyer708
      @robinheyer708 3 месяца назад

      Same, and then a few days later found out that it looked horrible on Safari because that browser doesn't allow you to style the ::marker (at least a year ago it didn't) so in the end went with list-style: none as they have here.

  • @zalkadridani
    @zalkadridani 3 месяца назад

    MasyaAllah, this video tutorial is great. It's all what I'm looking for. All videos in this channel is awesome. I like your voice too, even it's like mrbeast level 2,but it's ok. This voice help me to understand.

  • @divineanyanechi6928
    @divineanyanechi6928 Месяц назад

    Bro please how long did it take you to master all this?

  • @AbdallahElhussin
    @AbdallahElhussin 5 месяцев назад

    thank you 🥰

  • @premsingh6967
    @premsingh6967 Месяц назад

    it is very usfull feature 😀

  • @martin300169
    @martin300169 3 месяца назад

    Great !
    Where can we find the source code ?

  • @Ivan-Shyriaiev
    @Ivan-Shyriaiev 3 месяца назад

    Is it possible to make the content pop up animated ? Like a smooth height from 0 to 100% ?

  • @AntowaKartowa
    @AntowaKartowa 4 месяца назад +2

    But it seems it wouldn't collapse if you click anywhere outside.

  • @muhammadsami695
    @muhammadsami695 6 месяцев назад

    Basic to advanced JavaScript course with project please

  • @JustAGuyWithMemes
    @JustAGuyWithMemes 3 месяца назад

    what vscode theme do you use?

  • @amirfakhte9156
    @amirfakhte9156 3 месяца назад

    I didn't know Mr beast is making tutorial videos now

  • @chetankalania4709
    @chetankalania4709 12 дней назад

    But ig its not possible to transition the details as u can see when u click on account icon there is a sudden opening of the list that we gave to details now how can we transition it 😕

  • @ravisingh5906
    @ravisingh5906 4 месяца назад

    he is legend

  • @PH3217TrịnhHiếuNghĩaFPT
    @PH3217TrịnhHiếuNghĩaFPT 3 месяца назад

    Thanks

  • @GFXdesk2024
    @GFXdesk2024 4 месяца назад

    Bro 🎉❤ plz shear your theme with us

  • @luobohu-dx9xv
    @luobohu-dx9xv 6 месяцев назад

    wow,I like

  • @cjoshi0
    @cjoshi0 3 месяца назад

    What if screen shows 2 items in each row

  • @Johnathan_.
    @Johnathan_. 6 месяцев назад

    You are awesome mahn😮

  • @m-anees-c
    @m-anees-c 6 месяцев назад +1

  • @SogMosee
    @SogMosee 3 месяца назад

    Also whoch vscode theme is this?

    • @lundeveloper
      @lundeveloper  3 месяца назад

      it was created by me,
      You will find video tutorials on my channel

  • @maicon484
    @maicon484 2 месяца назад

    🎉

  • @Asliddin.Animuz
    @Asliddin.Animuz 3 месяца назад

    the cool

  • @hackerlord
    @hackerlord 3 месяца назад

    that crazy

  • @r_lonef
    @r_lonef 4 месяца назад +58

    please change this voice it's so uncomfortable

    • @_tanzil_
      @_tanzil_ 3 месяца назад +1

      And it's funny 😅

    • @Onyxxzx
      @Onyxxzx 3 месяца назад +2

      It's tts I guess!!

    • @snoopdogg9490
      @snoopdogg9490 3 месяца назад +1

      Its mr beast , you don't like mr beast?

    • @r_lonef
      @r_lonef 3 месяца назад +1

      @@snoopdogg9490 Don't act stupid it's not mr beast it's a damn AI.

    • @snoopdogg9490
      @snoopdogg9490 3 месяца назад

      @@r_lonef nah man , i am sure its mr beast i always knew he was a front end dev

  • @charith-q8m
    @charith-q8m 3 месяца назад

    The voice drops suddenly. Aww it's uncomfortable

  • @KamilKrol-tx5vg
    @KamilKrol-tx5vg 3 месяца назад

    wow !!! Great job sir. Please dont stop recorging your videos ;).

  • @ДмитрийС-ш9б
    @ДмитрийС-ш9б Месяц назад

    Контент хороший, но как же бесит эта синтетическая озвучка, прям🤮 Смотреть невозможно!

  • @Neil_09
    @Neil_09 3 месяца назад

    Mr beast voice clone is so annoying.

  • @apps9129
    @apps9129 3 месяца назад

    Yikes that voice. Please lower or remove the keyboard sounds as well

  • @MrJloa
    @MrJloa 3 месяца назад

    This is not collapsible.
    This is either popover menu or context action menu.
    Collapsible -- is an accordion 🪗

  • @Johnathan_.
    @Johnathan_. 6 месяцев назад +1

    Bro why don't you uploaded it 3 days before I wasted my 40 mins for writing js😂

    • @lundeveloper
      @lundeveloper  6 месяцев назад +1

      😅😅😅😅😅 I will try more