CSS, centering links inside div

前端 未结 4 1206

how can I center my links like this? They all are centered inside a div, but they begin from the same distance.

i am link 1
i am a longer link than          


        
4条回答
  •  逝去的感伤
    2021-02-14 18:33

    Do this: nest a left-aligned div in a center-aligned div.

    Content
    Longer Content
    Really long Content
    Content
    Content

    Addition:

    CSS lovers everywhere will condemn me for suggesting that you could replace the inner div with a table, which would remove the need to specify a fixed (or percentage) width.

提交回复
热议问题