concept close button in category css

appears as: Close button, close button, Close button
CSS in Depth

This is an excerpt from Manning's book CSS in Depth.

  • 6 Closes the modal when the user clicks the Close button
  • Listing 7.4. Replacing the Close button with an x

    7.2.1. Absolutely positioning the Close button

    To see how this works, let’s reposition the Close button to the top right corner of your modal dialog. After doing so, the modal will look like figure 7.2.

    Figure 7.2. Close button positioned at top right corner of modal dialog

    To do this, you’ll declare absolute positioning for the Close button. Its parent element is modal-body, which has fixed positioning, so it becomes the containing block for the button. Edit your button’s styles to match listing 7.3.

    sitemap

    Unable to load book!

    The book could not be loaded.

    (try again in a couple of minutes)

    manning.com homepage
    test yourself with a liveTest