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
  • #174713

    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 :
    Hope you understand what i am asking.


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


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



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