This position absolute mistake is ruining modals

Kevin Powell on YouTubeWatch on YouTube

SaveMark complete

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

IntermediateUI5 min

About this video

A short CSS tutorial explaining why positioning modal close buttons with position: absolute can cause avoidable problems, and a float-based alternative with its own gotcha. It suits front-end developers who already write CSS.

What you’ll learn

  • Explain why position absolute can break modal close buttons
  • Position a modal close button using floats instead
  • Avoid the float gotcha that appears in this layout