简体   繁体   English

如何使用HTML和CSS创建网格视图布局

[英]How to create grid view layout with HTML & CSS



I have create Grid layout with responsive like bellow: 我已经创建了响应如下的网格布局:

在此处输入图片说明

but I don't want to apply space after second rows. 但我不想在第二行之后加上空格。 I want to style like pintrest. 我想穿得像pintrest。

Exactly what I want is: 正是我想要的是:

在此处输入图片说明

My Sample : HTML 我的样本: HTML

I will appropriate If someone help to complete this view :) 如果有人帮助完成此视图,我将适当提供:)

Thanks 谢谢

You can easily do this using bootstrap 您可以使用引导程序轻松完成此操作

for eg 例如

<div class="row">
<div class="col-xs-3"></div>
<div class="col-xs-3"></div>
<div class="col-xs-3"></div>
<div class="col-xs-3"></div>
<div class="col-xs-3"></div>
<div class="col-xs-3"></div>
</div>

add as many as div you want. 添加所需的div。 They will grow horizontally as per content and then will be floated left. 它们将根据内容水平增长,然后向左浮动。

Here is your layout.. We have create demo content for your layout.. 这是您的布局。.我们已经为您的布局创建了演示内容。

Click on following link and download source code: http://www.chameleoninfotech.com/theme/mansory-layout/mansory-layout.zip 单击以下链接并下载源代码: http : //www.chameleoninfotech.com/theme/mansory-layout/mansory-layout.zip

I hope its helpful for you.. 希望对您有帮助。

Does something like this work for you? 这样的事情对您有用吗? basically what I explained in the comments: 基本上是我在评论中解释的内容:

EXAMPLE

I've used table-layout:fixed to keep the width from messing up. 我使用了table-layout:fixed以防止宽度弄乱。

You'd just need to adjust the width of the columns to suit your content 您只需要调整列的宽度以适合您的内容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM