CSS: How can I center a horizontal list? Display:Inline not working

前端 未结 1 1501
Happy的楠姐
Happy的楠姐 2021-01-01 21:11

I am having major trouble getting the simplest of codes to work. I want my css horizontal list to be centered, that\'s all.

Link here: http://bit.ly/LtIBai

I

1条回答
  •  醉梦人生
    2021-01-01 21:23

    The reason they refuse to center is because they are also floated to the left. Change dislay: inline to display: inline-block; float: none and they appear centered.

    Edit: There's a lot of (mostly unnecessary) CSS code in there so you'll probably need to tweak a few other things before it looks right, but the floating is what's causing the non-centering at least.

    0 讨论(0)
提交回复
热议问题