Split Accordions into Columns - Free CSS - Elementor Wordpress Tutorial - Elementor Pro

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ก.ย. 2023
  • Join our 'How to Start a Web Design Business' Course - and use strategies to grow, get clients, and generate recurring income: websquadron.co.uk/how-to-star...
    Book your 1-2-1 Consultation: websquadron.co.uk/socials
    This is how to Split Accordions into Columns - Free CSS - Elementor Wordpress Tutorial - Elementor Pro
    Thanks to Dave for the Code: daveden.co.uk/
    Code:
    selector .e-n-accordion{ display: block; column-count: 2; }
    selector .e-n-accordion-item{ break-inside: avoid;}
    We love to create - share - respond - and deliver.
    🧐 Learn with our Mastery Modules: websquadron.co.uk/web-design-...
    🔗 All of our Important Links: websquadron.co.uk/socials/
    😃 Join our Facebook Group: / 3309523509284305
    😃 Get Code Snippets Pro: r.freemius.com/10565/3304295/
    😃 Get Elementor Pro: be.elementor.com/visit/?bta=2...
    😃 Boost your TH-cam Analysis: www.tubebuddy.com/websquadron
    👕 Get our Merchandise: websquadron.co.uk/merchandise
    🥹 Support us: paypal.me/Websquadron
    Hire us to work on your Website!
    💌 info@websquadron.co.uk
    👩‍💻 Visit websquadron.co.uk
  • แนวปฏิบัติและการใช้ชีวิต

ความคิดเห็น • 42

  • @websquadron
    @websquadron  10 หลายเดือนก่อน +2

    Code:
    selector .e-n-accordion{ display: block; column-count: 2; }
    selector .e-n-accordion-item{ break-inside: avoid;}

    • @PerryWebCreations
      @PerryWebCreations 10 หลายเดือนก่อน

      How would you control how many columns for each screen size? example: change to 1 column for mobile.

    • @websquadron
      @websquadron  10 หลายเดือนก่อน +1

      Add @media min size css and that will sort it out

  • @franciscoantonioalvarezzam2781
    @franciscoantonioalvarezzam2781 6 หลายเดือนก่อน +2

    Hi, it wasn't working for me, but it was because in the current version of Elementor the classes had changed, so for the first line the new class for the selector is "elementor-accordion" and for the second line the new class for the selector is ".elementor-accordion-item", so the code goes like this:
    selector .elementor-accordion{ display: block; column-count: 2; }
    selector .elementor-accordion-item { break-inside: avoid;}
    Other than that is a great solution and it looks beautiful, thanks a lot!

    • @kimbarthelemy312
      @kimbarthelemy312 3 หลายเดือนก่อน

      Same here, the names changed again, so the code goes like this:
      selector .bdt-ep-accordion{
      display: block;
      column-count: 2;
      }
      selector .bdt-ep-accordion-item{
      break-inside: avoid;
      }
      Thanks a lot !

  • @daedaluxe
    @daedaluxe 10 หลายเดือนก่อน

    This is perfect, I've been having to use multiple accordions before

  • @PintoTV
    @PintoTV 8 หลายเดือนก่อน

    Great tutorial Imran!
    Exactly what i needed, you are the BEST :)

  • @QuaverloveStudio
    @QuaverloveStudio 10 หลายเดือนก่อน

    That's brilliant!

  • @pawaramit1924
    @pawaramit1924 10 หลายเดือนก่อน +1

    great u r method are always orsome ❤

  • @Website-Essentials
    @Website-Essentials 5 หลายเดือนก่อน

    Thanks for saving my day :)

  • @JohnXionidis
    @JohnXionidis 10 หลายเดือนก่อน +1

    Awesome!

  • @brunoaguilar689
    @brunoaguilar689 4 หลายเดือนก่อน +1

    Very good content thanks❤

    • @websquadron
      @websquadron  4 หลายเดือนก่อน

      Glad you liked it!

  • @michaltaub4850
    @michaltaub4850 4 หลายเดือนก่อน

    Hey
    Maybe you can help me with another problem?
    When I open an accordion it stretches text box from its next container
    How can this be prevented?
    thank you!

  • @fabriciolujano
    @fabriciolujano 10 หลายเดือนก่อน

    😂 you kept thinking about it from the live earlier today ;) amazing job man. 🎉

    • @fabriciolujano
      @fabriciolujano 10 หลายเดือนก่อน

      nice move man =)

  • @michaltaub4850
    @michaltaub4850 5 หลายเดือนก่อน

    Thank you :) It's great!!
    I have another question about the accordion, hope you can help
    I need to build 2 containers on the page next to each other, each container has a picture and next to the picture (on the right side) an accordion
    The problem is that when you open the accordion, it expands the images of the container -
    Is there a way to overcome this? And so that the opening of the accordion does not affect the length of the images?
    Thanks!

    • @websquadron
      @websquadron  5 หลายเดือนก่อน +1

      Add an image widget instead of Cover for the image (if it is set as Container BG Image) and then set the height/width. Or set the image to be Contain.

    • @michaltaub4850
      @michaltaub4850 5 หลายเดือนก่อน

      @@websquadron Thank you so much!!! You are the best :)

  • @CyberImpact7
    @CyberImpact7 10 หลายเดือนก่อน

    Can you make a video:
    Accordions with text and buttons and when you open one of the accordions the background image of the sections changes?

    • @websquadron
      @websquadron  10 หลายเดือนก่อน

      The container inside of the Accordion be changed for that.

  • @jppaglia1285
    @jppaglia1285 10 หลายเดือนก่อน

    Helpful, thanks! Though, I appear to be losing the top border on the second column. Also had to change the selector from ..e-n-accordion to: elementor-accordion (fwiw)

    • @websquadron
      @websquadron  10 หลายเดือนก่อน

      Have you set the borders for the heading and the content?

    • @jppaglia1285
      @jppaglia1285 10 หลายเดือนก่อน

      Thanks!@@websquadron - I set the border to 1px at Accordion > Style > Accordion. That's the only border setting I see other than the Advanced tab which sets a border around the entire thing.

    • @jppaglia1285
      @jppaglia1285 10 หลายเดือนก่อน +1

      fixed it by adding css border type and width to the offending accordion panel

  • @JohnXionidis
    @JohnXionidis 10 หลายเดือนก่อน

    Hello Imran, there is another version i found for this which equally good (if not better) utilizing display grid.
    selector .e-n-accordion {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(20rem, 41.667vw + 0rem, 31.25rem), 1fr));
    align-items: start;
    gap: 0 1.25rem;
    }
    selector .e-n-accordion-item {
    box-shadow: 0 0 0.625rem rgba(103, 103, 255, 0.05);
    }

    • @websquadron
      @websquadron  10 หลายเดือนก่อน +1

      Nice one

    • @PintoTV
      @PintoTV 8 หลายเดือนก่อน

      What you need to change to split it into 2?
      I tried your code and it got split into 4 columns :)

  • @iwbowden
    @iwbowden 10 หลายเดือนก่อน

    And how does this function on mobile? If the two or more columns remain (i.e. doesn't collapse into a single column) there's not a lot of point!

    • @websquadron
      @websquadron  10 หลายเดือนก่อน

      You would use the @media css to only have this apply for certain pixel widths.

  • @patolek11
    @patolek11 10 หลายเดือนก่อน +1

    +rep

  • @WebInspire29
    @WebInspire29 10 หลายเดือนก่อน +1

    🙄🙄🙄🙄

  • @backyardbees4355
    @backyardbees4355 10 หลายเดือนก่อน

    I'm sorry. I was excited, but this didn't work for me.

    • @websquadron
      @websquadron  10 หลายเดือนก่อน

      Why not? What went wrong?

    • @Christian-xn4xm
      @Christian-xn4xm 10 หลายเดือนก่อน

      Me neither. Nothing happens. Probably wrong class.

    • @backyardbees4355
      @backyardbees4355 10 หลายเดือนก่อน

      @@websquadron Thanks for getting back to me, sorry I didn't get back to YOU. I can't tell you what happened, other than to say "nothing." I watched it several times to make sure I got it right, but when I pasted...nothing.

    • @backyardbees4355
      @backyardbees4355 9 หลายเดือนก่อน +1

      @@websquadron guess what? I changed 'e.n." to "elementor-accordian" and it works now! Thank you!

    • @leandroiraishernandezferre4186
      @leandroiraishernandezferre4186 9 หลายเดือนก่อน

      @@websquadron Hi, it works for me, but when I open the accordion everything breaks and does not look good, I think the problem is in the second line of code
      selector .e-n-accordion-item{ break-inside: avoid;}
      with or without it, everything looks the same, what could be the error?