私は3つのネストされたdivの構造を持っています
<div id="div1">
<div id="div2"> // has come content
<div id="div3">
// has some content with a form
</div>
</div>
</div>
3 つの div はすべて絶対です。今、私がそうである
場合に#div3
応じて配置したい場合は、最も右側に移動する必要があります#div1
#div3
right:0px;
#div1
注:#div1
構造は私が作成したものではなく、私の管理下にないため、構造の修正を求めないでください#div2
。
私が持っている唯一のアイデアは、を移動してjQuery#div3
で追加することですが、可能であれば#div1
純粋なCSS
解決策が欲しいです。そうでなければ私はと一緒に行きますjQuery append
cssが不要になることをよく説明したと思います。しかし、それはCSSだと聞きます
#div1 {
position: absolute;
display: none;
}
#div2
{
position: absolute;
top: 85px;
left: 56px;
width: 300px;
z-index: 2;
}
#div3 {//what ever you want to write to make it relative to #div1 }