【发布时间】:2017-04-02 03:44:49
【问题描述】:
我正在尝试解决引导程序的样式问题。我是前端开发的新手,希望您能帮助我解决这个具体问题。我正在迭代淘汰员工名单。我为每个员工创建了一张包含 3 个部分的卡片:带有名称和按钮的部分, 图片,一般信息。它应该是这样的:
蓝色区域的白条就是我画出来的员工的名字。
<section id="picturesSection" class="background-image" data-bind="foreach: { data: people, as: 'person'}">
<div class="cardPositioning panel panel-primary">
<div class="panel-heading my-panel-heading">
<h3 class="panel-title cardTitle" data-bind="text: person.Name"></h3>
<button type="button" class="btn btn-primary btn-xs removeButton fa fa-minus" ></button>
</div>
<header>
<!--<img width="256" height="256" src="app/Images/horse.jpg">-->
<img width="256" height="256" data-bind="attr:{src: 'app/' + person.srcImage}">
</header>
<footer>
<!-- $data.firstName-->
<p class="nameEmployeePos" data-bind="text: person.DateOfBirth"></p>
<p class="nameEmployeePos" data-bind="text: person.Role"></p>
<p class="nameEmployeePos" data-bind="text: person.Email"></p>
</footer>
</div>
</section>
还有CSS
#picturesSection{
width: 100%; overflow: hidden;
}
.cardPositioning{
float: left;
margin:20px;
}
.background-image {
background-image: url("../Images/back.png");
width: 100%;
z-index: 10;
background-position-x: 1400px;
background-position-y: 400px;
background-repeat: no-repeat;
background-attachment: fixed;
}
.removeButton{
margin-bottom: 2px;
margin-left: 0px;
margin-right: 0px;
}
问题是如何将按钮放置在代表“减号”图标的卡片中。我需要该按钮来从数据库中删除员工。我想在蓝色空间的右上角有按钮。 Bootstrap 在 panel panel-primary 类中有一些填充,由于员工姓名的位置(我想保留),我不想删除这些填充。想知道如果可能的话我该如何解决这些问题。提前致谢!
【问题讨论】:
标签: jquery html css twitter-bootstrap knockout.js