gpt4 book ai didi

angularjs - Flex in grand(grand)children of row layout

转载 作者:行者123 更新时间:2023-11-28 05:58:32 25 4
gpt4 key购买 nike

我想使用 flex“系统”来获得看起来像如下图所示,但我的布局 div 和 flex 之间有一些生成的指令:

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 的样式,但是没有更简洁的方法吗?

最佳答案

您需要使用 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

关于angularjs - Flex in grand(grand)children of row layout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36915022/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com