geerlingguy / jeffgeerling-com

Drupal Codebase for JeffGeerling.com
https://www.jeffgeerling.com
GNU General Public License v2.0
41 stars 2 forks source link

Make YouTube embeds not full-width on desktop/tablet #132

Closed geerlingguy closed 3 years ago

geerlingguy commented 3 years ago

They just look... too big.

Just adding a width on the div seems not to work.

geerlingguy commented 3 years ago

Hmm... the responsive iframe technique being employed is using a 16:9 aspect ratio for the embed, see: https://www.w3schools.com/howto/howto_css_responsive_iframes.asp

But I can't just modify CSS with what http://embedresponsively.com spits out, so I have to add a wrapper div (styled below) around the embed so I can limit its width and center it:

.yt-embed {
  max-width: 650px;
  margin: 0 auto;
}