我的小冊子地圖覆蓋了地圖的標題,它應該剛好位於地圖上方。我使用CSS和Bootstrap來對齊頁面元素。查看該圖像:以下是代碼:是CSS和Bootstrap對齊問題
<style type="text/css">
body, html {
height: 100%;
margin: 0;
padding: 0;
}
div {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
img {
width:97%; /* you can use % */
height: auto;
}
div#location {
width:600px;
height:400px;
}
div#datatable {height:700px; overflow-y:scroll; width: 425px word-wrap: break-word;}
td.dc-table-label {display:none;}
span.dc-data-count {font-size:.5em;}
span.dc-data-count {font-weight: normal;}
table#media-table {
background-color: black;
color:white;
padding: 0;
}
<div class="container" style="padding-top:20px">
<h2 class="page-title">Ivan Doig Archive Explorer <span class="dc-data-count">Showing <span class="filter-count"></span> of <span class="total-count"></span> photographs {<a href="javascript:dc.filterAll(); dc.renderAll();">reset</a>}</span>
</h2>
<div class="row">
<div class="col-md-4">
<strong><span id="datatable"></span>Media</strong>
<table class="table table-hover" id="media-table"></table>
</div>
<div class="col-md-6" id="location">
<strong><span id="map"></span>Location</strong>
</div>
</div>
引用的數據表,並在地圖上,如下所示:
var map = dc.leafletMarkerChart("#location", groupname)
var dataTable = dc.dataTable("#media-table", groupname)
地圖假定與「幻燈片」的頂部對齊,並且與「媒體」一樣擁有「位置」的標題。這將允許在每個元素的頂部添加彙總統計信息。
嘗試用'margin-top'將其向下移動。 – TricksfortheWeb
我剛剛嘗試添加:'div#location {margin:margin-top:20; width:600px; height:400px;並且具有相同的結果。 – mutanthumb
標題應該在哪裏? – TricksfortheWeb