Jump to content

Embed a YT video in accordion (noob here)

Recommended Posts

  • 2 weeks later...
  • Replies 9
  • Views 650
  • Created
  • Last Reply

Top Posters In This Topic

On 3/22/2022 at 8:50 PM, vocatvie said:

Hi tuanphan,

I just used the Accordion Plugin of sqspthemes and managed to create nice Accordions but I would like to add thumbnails to the tabs like this - https://drive.google.com/open?id=1A089tLYRMUrvQIk_3tpVmLIqLYozgDxv&authuser=kraftpotenzial%40gmail.com&usp=drive_fs

How can I do this?

https://www.kraftpotenzial.com/accoblocks

(Just a test code)

Try adding this to Design > Custom CSS

/* Accordion - Add an image next to title */
div.c-tabs__content>a {
    padding-left: 70px;
    position: relative;
    margin-bottom: 10px;
}
div.c-tabs__content>a:before {
    content: "";
    width: 50px;
    height: 50px;
    display: inline-block;
    position: absolute;
    left: 0;
    top: 0;
}
/* first item */
a#tab-video---vimeo:before {
    background-image: url(https://cdn.pixabay.com/photo/2022/02/23/18/11/drink-7031154__480.jpg);
}
/* second item */
a#tab-video---youtube:before {
    background-image: url(https://cdn.pixabay.com/photo/2021/12/21/08/29/owl-6884773__340.jpg);
}
/* third item */
a#tab-video---embedded-gooogle-drive:before {
    background-image: url(https://cdn.pixabay.com/photo/2022/03/03/11/18/nature-7045125__340.jpg);
}

image.thumb.png.95a0fe4816a43575d880e6413b9aded7.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 3/24/2022 at 5:40 PM, vocatvie said:

Hi Tuan,

Nice! Thanks.

I was trying to upload a 640 x 480 px image, but the image doesn't resize and also the text is not centered vertically.

Can you make it responsive too? Like this - https://drive.google.com/file/d/1h8Q3gyl1eOU_TP6oDgTsvLy39O8RcxfK/view?usp=sharing
 

Try edit this code

div.c-tabs__content>a:before {
    content: "";
    width: 10em;
    height: 100%;
    display: inline-block;
    position: absolute;
    left: 0;
    top: 0;
}

to this new code (I added background-size: cover;)

div.c-tabs__content>a:before {
    content: "";
    width: 10em;
    height: 100%;
    display: inline-block;
    position: absolute;
    left: 0;
    top: 0;
    background-size: cover;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 3/28/2022 at 5:23 PM, vocatvie said:

Can you help me to style this site - https://www.kraftpotenzial.com/accoportfolio too to match the design exactly like CSS above? Currently, the pic is centered and above the title - I also want to make it like this page - https://www.kraftpotenzial.com/accoblocks (picture to the left and title+icon horizontally centered to the right) 

Hi, You mean reduce image size? https://www.kraftpotenzial.com/accoportfolio

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 3/31/2022 at 12:31 AM, vocatvie said:

Yes the Portfolio Accordion should also look like this too:

image.thumb.png.42e27cec9b90a8f30af864f1efa19b22.png

Add to Page Header

<style>
  .c-tabs__accordion-tab .c-tabs__tab-img, .c-tabs__accordion-tab .c-tabs__tab-img img {
    padding-bottom: 0 !important;
    margin-right: 20px;
}
</style>
  

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.