css list inline is not listing items horizontally?

后端 未结 5 1144
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-31 07:13

I don\'t know why this is not displayed right, the list is meant to display horizontally? Instead it is displaying vertically!

this is my code:

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-31 07:35

    There are multiple solutions: you could change li to display: inline-block; or h1 to display:inline; (keep in mind to use only one h1 per site and to use it semantically correct! If you just want to style a word or a sentence which isn't really a h2 or 3 then use span's, em's or strong's.

    Also it's important that an inline-a-Tag can't enclose a block-whatever-Tag that is if you're not developing for HTML5 where you can enclose just anything in an a-Tag.

    Also if you can, omit floating for a thing that can be achieved with more backwards compatibilty

提交回复
热议问题