Skip to main content
Centering embedded video Started by Burke Knight · · Read 9895 times 0 Members and 1 Guest are viewing this topic. previous topic - next topic

Centering embedded video

Enable auto-embedding of video links.

I love this, but there's an issue I have found.
The inability to center the video.
I've tried all the css tricks I could think of, to no avail.
Not sure if YouTube has something coded in their end that limits the ability or not.

Re: Centering embedded video

Reply #1

There are s a lot of items going on in that.  We have the preview image, then the actual loading of the video (usually in an iframe) and the collapse box as well.

to center a video on the page, you could try adding

Code: [Select]
.elk_video_container {
display: grid;
justify-content: center;
}
to your index.css right above the .elk_video { section and see if that gives the desired effect.

Re: Centering embedded video

Reply #2

I added it to custom.css and it works great.
I did my usual !important to be sure it would override.

Thank you, my friend.  :smiley:

Re: Centering embedded video

Reply #3

One thing to consider doing is make use the custom.css file.

Its a good place to add theme overrides and makes it easier to update a theme since it has not been directly edited.  custom.css is loaded last (if it exists) so it "over-writes' any previous selectors.   You can do the same with a custom.css file in the _variant directory to overwrite colors.

Re: Centering embedded video

Reply #4

Quote from: Spuds – custom.css is loaded last (if it exists) so it "over-writes' any previous selectors.

I still need to do the !important though.
Not sure if there's a way to make sure it overrides without having to do so, but it's something I felt needed to be said.

Quote from: Spuds – You can do the same with a custom.css file in the _variant directory to overwrite colors.

I didn't know about this one. Good to know.  :smiley: