gpt4 book ai didi

css - 当 core-animated-pages 在各部分之间切换时,如何使 DIV 自动调整其高度?

转载 作者:行者123 更新时间:2023-11-28 08:39:22 25 4
gpt4 key购买 nike

当 core-animated-pages 在部分之间切换时,如何使(红色)DIV 自动调整其高度? (高度应与部分相符)这种情况可以使用Polymer垂直布局属性吗?这是 Plunker example .

<style> 
div#wrapper {
border: 2px solid;
padding: 10px 40px;
resize: both;
overflow: auto;
height:100%;

}

div.container {

}
</style>

<body unresolved>

<template is="auto-binding" id="t" >


Start
<br><br>

<div id="wrapper" style="background:red;">

<core-animated-pages
id="core_animated_pages_1"
selected="one"
valueattr="hash_1"
transitions="slide-from-right">

<section hash_1="one" >
<div class="container">

<h3 hash_1="five" on-click="{{handleClick_1}}">
Click to Switch to option:five(from inside the animated page)
</h3>
<br><br>
This line should be visible.
<br><br>

</div>
</section>


<section hash_1="five">
<div class="container">

<h3 hash_1="one" on-click="{{handleClick_1}}">
Back to option one(from inside the animated page)
</h3>

<br><br>
1
<br><br>
2
<br><br>
3
<br><br>
4
<br><br>
5
<br><br>

</div>
</section>

</core-animated-pages>


</div>


<br><br>
End
<br><br>

</template>

最佳答案

Setting the height of core-pages elements?

将此样式添加到部分:

<section style="position: relative; display: block;">
<div label="">One</div>
</section>

//or using layout attributes
<section relative block>
<div label="">One</div>
</section>

关于css - 当 core-animated-pages 在各部分之间切换时,如何使 DIV 自动调整其高度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27890290/

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