2016-04-28 16 views
0

フレックス "システム"を使用して、 のような画像を取得したいのですが、私のレイアウトdivとフレックスの間に指示がいくつかあります。行レイアウトのグランド(グランド)の子供たち

enter image description here

<div id="i-can-control-this-div" layout="row" layout-wrap> 
    <div id="uncontrolled-div-generated-by-vendor-directive"> 
    <div id="another-generated-div"> 
     <div id="maybe-the-last-one"> 
     <div id="uncontrollable-div-arround-each-flex"> 
      <div flex="66">[flex=66]</div> 
     </div> 
     <div id="uncontrollable-div-arround-each-flex"> 
      <div flex="33"> 
      <div style="height:100px">[flex=33]</div> 
      </div> 
     </div> 
     <div id="uncontrollable-div-arround-each-flex"> 
      <div flex="66">[flex=66]</div> 
     </div> 
     <div id="uncontrollable-div-arround-each-flex"> 
      <div flex="33">[flex=33]</div> 
     </div> 
     <div id="uncontrollable-div-arround-each-flex"> 
      <div flex="33">[flex=33]</div> 
     </div> 
     <div id="uncontrollable-div-arround-each-flex"> 
      <div flex="33">[flex=33]</div> 
     </div> 
     <div id="uncontrollable-div-arround-each-flex"> 
      <div flex="33">[flex=33]</div> 
     </div> 
     </div> 
    </div> 
    </div> 
</div> 

私にこのCodePen上の最初のセクションのように見える何かを与えます。私はJQueryのスタイルをそのdivの中から選ぶことができると思いますが、そこにはクリーンな方法はありませんか?

+0

なぜ、あなたは非常に深いレベルのコンテナ要素を使用しますか? – nextt1

+0

私は個人的には望んでいませんが、私が使っているベンダーディレクティブは "i-can-control-this-div"と "flex = *" divの間にこの種の深さを生成します – Nephidream

+0

これは動作しますか? http://codepen.io/next1/pen/xVyPGw 'flex'はコンテナの直後の後継者とそのすべての兄弟にのみ与えられるべきです。 – nextt1

答えて

0

flex属性を使用する必要があります。これにより、すべての使用可能な幅が含まれます。

<div id="i-can-control-this-div"> 
<div id="uncontrolled-div-generated-by-vendor-directive"> 
    <div id="another-generated-div"> 
    <div layout="row" flex layout-wrap id="maybe-the-last-one"> 
     <div flex="66" id="uncontrollable-div-arround-each-fl"> 
     <div>[flex=66]</div> 
     </div> 
     <div id="uncontrollable-div-arround-each-flex" flex="33"> 
     <div> 
      <div style="height:100px">[flex=33]</div> 
     </div> 
     </div> 
     <div flex="33" id="uncontrollable-div-arround-each-flex"> 
     <div >[flex=33]</div> 
     </div> 
     <div flex="66" id="uncontrollable-div-arround-each-flex"> 
     <div>[flex=66]</div> 
     </div> 
     <div flex="33" id="uncontrollable-div-arround-each-flex"> 
     <div >[flex=33]</div> 
     </div> 
     <div flex="33" id="uncontrollable-div-arround-each-flex"> 
     <div >[flex=33]</div> 
     </div> 
     <div flex="33"id="uncontrollable-div-arround-each-flex"> 
     <div >[flex=33]</div> 
     </div> 
    </div> 
    </div> 
</div> 

例を取り組んでいます。 http://codepen.io/next1/pen/xVyPGw

関連する問題