How can css be changed during php loop output to achieve typographical and line feed effects? for example, if I want to achieve this effect, several pieces of data are taken from the database and each piece of data is put into a p file, each p is a cell in it, with four rows. it is enough for the four cells to automatically route to the next row.
When I encountered css during the loop, I don't know what to do with css? Thoughts
This is the case now.
$ Value ['item _ name']
1212 votes
Vote
Reply to discussion (solution)
The page width can be fixed, the width of each element block is fixed, the element block is set to float, and css is used to ensure that each line is exactly four. In this way, each element block can be output cyclically.
You can output $ key to determine the line feed by judging the key value. for example, if you want to display four lines, end p when if $ key/4 = 0
And start the new p
Good luck
Float floating