Video Lightbox Button Styling

Hello,

My goal is to have a button that triggers a lightbox to play a video. I tried to use the modal element with no luck. I now am trying to style a shortcode button with the raw element. I am not sure if there is a better way to achieve what I want. I wouldn’t mind using the button element but I don’t think you can trigger a lightbox window from it can you?

I am hoping that you might be able to help me get the styling figured out on the button? In the pictured attached I am trying to style the last button. I would like it to be exactly like the ones above it. The content is not being centered exactly and it is not mobile friendly like the other ones.

Here is the page link. http://eversightvision.org/on-demand-product-page/

.x-btn.lightbox-btn {
display: inline-flex;
position: relative;
flex-direction: row-reverse;
justify-content: space-between;
align-content: center;
color:#44a8c6;
background:transparent;
border: 1px solid #44a8c6;
font-size:.9em;
height:0vh;
min-width:100%;
text-align: left;
border-top-left-radius: 0.35em;
border-top-right-radius: 0.35em;
border-bottom-right-radius: 0.35em;
border-bottom-left-radius: 0.35em;
padding-top:2vh;
padding-right:0vw;
padding-bottom:2vh;
padding-left:1vw;
}

Hello @pingland222,

Thanks for asking. :slight_smile:

I would suggest you to assign class to the button element ex center-button-lightbox. After that please add following CSS under Pro > Theme Options > CSS:

@media only screen and (max-width: 600px) {
    .center-button-lightbox {
    display: flex !important;
    align-items: center !important;
}
}

If you don’t want to add class then add following CSS:

@media only screen and (max-width: 600px) {
    .x-btn.lightbox-btn {
    display: flex !important;
    align-items: center !important;
}
}

If you would like to learn CSS, I am sharing few resources that you take a look to get started with CSS and an interesting tool that you can use to speed up the development process.

I recommend you to watch following video that will help you to get started with CSS.

https://www.youtube.com/watch?v=MFR4WXiLzpc

Sometimes it can get a bit difficult to find out the right selector to be able to write the required CSS codes. A handy tool that can help you in this is Google Chrome dev tools. I am sharing the resource that you can refer to get started with dev tools.

https://developers.google.com/web/tools/chrome-devtools/css/

https://developers.google.com/web/tools/chrome-devtools/

https://www.youtube.com/watch?v=tP_kXBJWPhQ&t=200s

Thanks.

Thanks! I was able to clean the code up and get everything to work. Thanks for the resources as well. CSS is somewhat new to me so these videos are awesome!

You’re welcome. Glad we could help.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.