如何获得 CSS 布局,如 elkaniho.com/
这个网站 http://www.elkaniho.com/ 有一个 CSS 布局,这就是我想要的,你看,div 彼此堆叠,不是在精确的网格上,而是在底部和侧面。
当您重新调整浏览器大小时,它们都会完美地重新调整吗?
有人知道我如何获得与 elkaniho.com 相同的布局,或者这叫什么类型的布局?
This website http://www.elkaniho.com/ has a CSS layout which is what i want, you see, the divs stack on top of each other, not on a precise grid, but just at the bottom and on the side.
And when you re-size the browser, they all re-adjust perfectly?
anyone know how i can get the same layout like at elkaniho.com or what type of layout this is called?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你所说的效果是使用javascript创建的。如果您查看源代码,您会发现一个名为 funciones.js 的 javascript 文件的链接,其中包含负责此效果的名为 cajas 和 cajasInterior 的函数。另请注意,他们正在使用 jQuery。
功能:
我会联系该网站的网站管理员,请求允许使用此脚本并更改它以满足您的需求。
The effect you are speaking of is created using javascript. If you look at the source code, you will find a link to a javascript file called funciones.js which includes functions called cajas and cajasInterior that are responsible for this effect. Also note that they are using jQuery.
The functions:
I would contact the webmaster of the site and ask permission to use this script and change it to fit your needs.
还有一个名为 Masonry 的简洁 jQuery 插件,可以处理不同宽度和堆栈的 div尽可能将它们紧紧地固定住。取决于你的内容。
There is also a neat jQuery plugin called Masonry that can deal with div's of varying width and stacks them up as tightly as possible. Depends on your content.
这只是一个六列布局。使用 6 个 div 即可轻松完成:
作为流体布局:
您当然也可以固定宽度。
每列都有几个 div,它们执行 div(实际上是任何块元素)的操作:它们从上到下堆叠。
That's just a six column layout. Easily done with 6 divs:
As a fluid layout:
You can of course fix the widths too.
Each column then has several divs which do what divs (and in fact any block element) do: they stack top to bottom.