Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Improvement on ghost element centering technique

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #44148
    tranzfuse
    Member

    Hi,

    When working on a responsive landing page I ran into a weird issue with the ghost element centering technique that is documented here:

    https://css-tricks.com/centering-in-the-unknown/

    Where in Firefox and IE9 the centered element would collapse beneath the ghost element in narrower desktop browsers. I scoured the internet and the comments thread of the above article and came up with nothing. A coworker suggested using white-space: nowrap on the containing element, and sure enough this fixed the problem! Needless to see I was super happy and wanted to share in case someone else is banging their heads against the wall with this.

    A simple use case is here: http://codepen.io/tranzfuse/full/EBFzy

    Hopefully this helps someone else out.

    Cheers,

    Adam

Viewing 1 post (of 1 total)
  • The forum ‘CSS’ is closed to new topics and replies.