css - 文字排版问题,内容都是动态抓出来的,字数不一定。如何对齐啊
PHPz
PHPz 2017-04-17 11:18:16
0
5
753

左边类似: 品牌啊 分类啊 下面的产品产品属性啊. 都是动态抓出来的, 现在的要求就是。
他们要对齐, 让后面的全部都在一条直线上, 由于是动态的, 没定宽,还有也不可能去填空格吧
letter-spacing也不行.

大家是如何解决的这个问题的呢 ?

PHPz
PHPz

学习是最好的投资!

reply all(5)
洪涛

Two methods,

First, set a fixed width for the container. Set a height of 2 rows for the container on the left and center it vertically. If it is too long, it will automatically wrap.

Second, after loading them all, use a script to find the widest one on the left, and then set the width on the left uniformly.

Speaking of which... why is it so long? There must be a limit. Then setting a fixed width is the easiest way.

Ty80

Why not use table

PHPzhong

This type of navigation is not suitable for line breaks. You can use table and then set left alignment for td to force no line breaks.
Or, all red icons can be floated to the right and aligned to the right.

迷茫

I don’t know if I understand you correctly. Did you mean:

The "All" button on the right is aligned, and at the same time, the text on the left is aligned to the right?

Then why not use float:right attribute

黄舟

Table is required here.
The left TD will be automatically expanded to the longest width.
Just place a payment on the right side.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template