2016-11-19 19 views
0

我有following plunker,正如你所看到的(我默認打開它)SVG對象放置在HTML的對象上。儘管z-index爲-1(我也試過100)。爲什麼我不能使用z-index在SVG上放置div

// Navbar Component 
:host.opened{ 
    height: 136px; 
    z-index: 9999; 
} 
// SVG Component 
this.svg = d3.select(this.elementRef.nativeElement) 
    .append("svg") 
    .attr("width", 1200) 
    .attr("height", 400) 
    .style("z-index", -1) 

我怎麼可能有大約在SVG迫使該HTML層的一個

回答

2

Svg爲不使用的z-index

坐落在DOM父的z-index

[_nghost-qtc-0] jg-sankey { 
    position: absolute; 
    top: 50px; 
    left: 0px; 
    z-index: -10; 
} 
+0

這與使用主機有何不同? – Jackie

+0

在你的例子中,你沒有在jg-sankey上設置任何z-index ...你正在爲.opened類設置一個z-index,但是這個應用於jg-navbar。 – vals

相關問題