Forums

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

Home Forums Other Inline element showing height after using float property.

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #174713
    ravinder07
    Participant

    Hi, I searched on google and found some topic about inlinefloat but did not find the exact answer so i am making thread here.

    what i know about inlineproperty is that :
    Inline : Width, Height and vertical margin is ignored only horizontal margin acknowledged and same for padding, horizontal padding is acknowledge but vertical is ignored.

    As we know when element is display:inline; it ignore the heightproperty
    but i found that when i add floatproperty to the inlineelement then it start showing heightwhatever it is inline element and also start displacing the other element coming in its height box area.

    This behavior is kinda strange for me. Could somebody explain it. Why inline element showing height after putting float property to it.
    It kinda behave like block element just not displacing its left and right side content to make its room.

    Here is codepen : http://codepen.io/anon/pen/qjKBd
    Hope you understand what i am asking.

    #174719
    Senff
    Participant

    When you add a float to an element, it automatically becomes a block.

    #174722
    Paulie_D
    Member

    So perhaps what is needed is display:inline-block.

    #174729
    ravinder07
    Participant

    interesting:)

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