Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
283 views
in Technique[技术] by (71.8m points)

html - Any ideas on how I could implement a grid-view in CSS? - CSS

Here is an example grid-view:

alt text

Also another example from TED.com

alt text


Any ideas on how I could go on about implementing a dynamic grid like this in CSS?

I guess it might have something to do with dividing the box in units styled with float:left, and each unit would have a border if on a boxes border.

Help would be very appreciated =)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I've achieved a similar grid in the past with David Desandro's awesome jQuery Masonry plugin. As that page illustrates, CSS floats aren't so great for grid layouts, and setting up "units" like you describe could be a massive headache, depending on the complexity of the grid and range of cell sizes.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...