2015-06-11 28 views
0

我正在嘗試d3.js.我所擁有的只是一個非常簡單的標題(bootstrapped html)和d3.js圖形。我希望標題在圖上可見,而目前容器覆蓋它。如何讓JavaScript流過其他頁面元素

<!DOCTYPE html> 
<html> 
<head> 
    <title>Graph/index</title> 
    <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> 
    <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> 
    <script src="https://d3js.org/d3.min.js" charset="utf-8"></script> 
    <%= csrf_meta_tags %> 
<div class="container-full"> 
     <div class="row"> 
     <div class="col-lg-12 text-center v-center"> 
      <h1>My.app</h1> 
      <br> 
      <form class="col-lg-12"> 
      <div class="input-group input-group-lg col-sm-offset-4 col-sm-4"> 
       <input type="text" class="center-block form-control input-lg" title="Enter you email." placeholder="My app"> 
       <span class="input-group-btn"><button class="btn btn-lg btn-primary" type="button">OK</button></span> 
      </div> 
      </form> 
     </div> 
     </div> <!-- /row --> 
     <div class="row"> 
     <div class="col-lg-12 text-center v-center" style="font-size:39pt;"> 
      <a href="#"><i class="icon-google-plus"></i></a> <a href="#"><i class="icon-facebook"></i></a> <a href="#"><i class="icon-twitter"></i></a> <a href="#"><i class="icon-github"></i></a> <a href="#"><i class="icon-pinterest"></i></a> 
     </div> 
     </div> 
    <br><br><br><br><br> 
</div> <!-- /container full --> 
<style> 
</style> 
</head> 
<body> 
    <%= yield %> 
<%= javascript_include_tag('graph') %> 
</body> 
</html> 

回答

2

使用CSS應用以下屬性您的標題:

z-index: 99; 

的z-index是一個樣式屬性定義元素的堆疊順序。指數越高,它進一步向前疊加。例如,具有z索引1的元素位於沒有定義z索引的任何元素之前,但位於具有z索引5的元素之後。

相關問題