What is the difference between Float:left vs Display:inline? While every element in browser goes to left by default

后端 未结 8 2030
星月不相逢
星月不相逢 2020-12-01 04:28

What is the differences between Float vs Display:inline? by default everything goes to left side in every browser. then 2 display inlined elements should be worked same lik

8条回答
  •  一生所求
    2020-12-01 05:11

    display: inline means that the element acts like a instead of a

    : i.e. it is not a block.

    Elements that are floated are not in the normal flow of the document. Here is a good description.

    ETA:

    Try this code. If you can't see the difference then I can't help you.

    
    
    
    
    
    
    

    The is an inline paragraph with lots of words.

    The is an inline paragraph with lots of words.



    The is a left floated paragraph with lots of words.

    The is a right floated paragraph with lots of words.

提交回复
热议问题