Forums

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

Home Forums CSS childs wont fit in inline

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #46255
    VladimirKrstic
    Participant

    Hi,

    lets say you have element with 300px width and two childs in it with 150px width, 0 padding, 0 margin and inline-block. Why they wont fit perfectly in one line? Same is with percentages. Someone can help, explain?

    #142016
    Paulie_D
    Member

    Inline block unfortunately includes space for HMTL white-space.

    There are techniques for dealing with this…the easiest (possibly) is to set the font-size of the parent to 0.

    You will have to re-set the font-size for the children though.

    http://joshnh.com/2012/02/07/why-you-should-use-inline-block-when-positioning-elements/

    #142019
    VladimirKrstic
    Participant

    Works perfectly, thank you, cheers!

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