[英]Bootstrap: How to make repeated divs go around a fixed div
I'm trying to accomplish the following, make repeated divs "go around" a fixed div. 我正在尝试完成以下操作,使重复的div“绕开”一个固定的div。 The content of the repeated divs will be created dynamically using Bootstrap thumbnails.
重复div的内容将使用Bootstrap缩略图动态创建。
Here's an image that illustrates what i'm trying to do: 这是一张图像,说明我正在尝试做的事情:
How can i do this with CSS (or Javascript, or who knows... Bootstrap)? 我该如何使用CSS(或Javascript,或谁知道... Bootstrap)呢?
You can to it with simple CSS : 您可以使用简单的CSS来实现:
html, body { margin: 0; } .container { width: 960px; margin: 0 auto; } .block { background: #2ecc71; width: 460px; height: 460px; margin: 10px; float: right; } .item { background: #e74c3c; width: 220px; height: 220px; margin: 10px; float: left; }
<div class="container"> <div class="block"></div> <div class="item"></div> <div class="item"></div> <div class="item"></div> <div class="item"></div> <div class="item"></div> <div class="item"></div> <div class="item"></div> <div class="item"></div> </div>
I know tables are a bit out of fashion, however... 我知道桌子有点过时了,但是...
<table border="1" style="width:300px;">
<tr>
<td>1</td>
<td>2</td>
<td rowspan="2" colspan="2">hello</td>
</tr>
<tr>
<td>3</td>
<td>4</td>
</tr>
<tr>
<td>5</td>
<td>6</td>
<td>7</td>
<td>8</td>
</tr>
</table>
apologies for the border="1"
, it's just handy to demo what's going on. 为
border="1"
表示歉意,演示发生的事情很方便。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.