我有这些蓝色正方形,我想要在两条线上水平溢出(每次创建一个新的正方形,它在上面的行和下面的行之间交替,依此类推)你可以使用CSS,Sass,JavaScript或jQuery ..我希望这个用于我的项目,因为这只是前端和后端代码生成新的方块......并且非常感谢...
这是我的代码:
<head>
<style>
.test {
background: blue;
width: 372.1478174125px;
height: 230px;
margin: 5px;
display: inline-block;
}
.horizontal {
background: gray;
height: 640px;
margin: 0px;
padding: 0px;
white-space: nowrap;
}
</style>
</head>
<body>
<div class= "horizontal">
<div class = "test"> hello </div><div class = "test"> hello </div>
<div class = "test"> hello </div>
<div class = "test"> hello </div>
<div class = "test"> hello </div>
<div class = "test"> hello </div>
<div class = "test"> hello </div>
<div class = "test"> hello </div>
<div class = "test"> hello </div>
<div class = "test"> hello </div>
</div>
</body>
答案 0 :(得分:1)
请检查这是否符合您的要求。
https://codepen.io/anon/pen/MrNqwo?editors=1100
这是我改变的风格。
<select [(ngModel)]="selected">
<option *ngFor="let option of optionArray" [value]="option">{{option}}</option>
</select>
<span *ngIf="selected" class="input-group-btn">
<button class="btn btn-primary save-button" type="submit">Save</button>
</span>