Link to home
Create AccountLog in
CSS

CSS

--

Questions

--

Followers

Top Experts

Avatar of egoselfaxis
egoselfaxis

Reducing top and bottom margins/padding around embedded Vimeo video?
I have an embedded Vimeo video on this Boostrap based homepage:

http://www.workforlgihomes.com/

Currently, there's some unwanted top and bottom margins and/or padding that I'd like to remove, .. although I can't seem to figure out how, as it appears that the unwanted spacing is being controlled by CSS that's contained within the iframe.  Does anyone here know  I can remove those excessive top and bottom margins around the embedded video?

Thanks,
- Yvan

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Julian HansenJulian Hansen🇿🇦

Add this to the container page.
.vimeo-wrapper {
	padding: 0;
	margin: 0;
}

Open in new window

Padding and margin on the vimeo Iframe is fine - it is the vimeo-wrapper that is the problem

Avatar of egoselfaxisegoselfaxis

ASKER

I tried what you suggested but it didn't work.  As I mentioned, I suspect that it might be being caused by some CSS that's contained within the embedded iframe.

- yg

Avatar of David FavorDavid Favor🇺🇸

Has something to do with the height setting a 100%.

If I run Chrome + Inspect + then for the body tag, disable height == 100%, white space collapses.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


The problem is not in the iFrame. it is caused by this line
.embed-responsive-4by3 {
	padding-bottom: 75%; /*<== Change to 50%*/
}

Open in new window


Hmm .. changing the CSS for that element isn't going to work, as it's resulting in the media control bar getting hidden when I reduce the padding percentage to 50%.  I'm now wondering if I might need to ditch the current bootstrap approach for responsive embedded vimeo videos and to instead try to achieve it using some other approach.  

The challenge seems to be with maintaining the proper height / aspect ratio for the video when resizing the browser.  Any suggestions?

- Yvan

ASKER CERTIFIED SOLUTION
Avatar of Julian HansenJulian Hansen🇿🇦

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Thanks Julian!  that did the trick.

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


You are welcome.
CSS

CSS

--

Questions

--

Followers

Top Experts

Cascading Style Sheets (CSS) is a language used for describing the look and formatting of a document written in a markup language. Usually used to change web pages and user interfaces written in HTML, it can also be applied to any kind of XML document. CSS is designed primarily to distinguish the content of a document from its presentation.