How to create a modal with HTML, CSS & JS - Part 2: CSS

Kevin Powell on YouTubeWatch on YouTube

SaveMark complete

Sign in to save videos and track what you’ve finished.

IntermediateUI24 min

About this video

Continues the modal tutorial by styling it with CSS, including making an element wider than its container and using object-fit to limit an image's height without distortion. Suited to viewers who already know basic HTML and CSS.

What you’ll learn

  • Style a modal dialog with CSS layout techniques
  • Make an element extend wider than its container
  • Use object-fit to constrain image height without squishing