gpt4 book ai didi

css - 样式化 Google Polymer 的纸张 slider 元素

转载 作者:太空宇宙 更新时间:2023-11-03 17:54:14 25 4
gpt4 key购买 nike

我有一个包含许多纸张 slider 元素的表单。我想减少它们之间的垂直空间,但在调整样式以使其工作时遇到了麻烦。这是一个例子。我希望这些控件不超出它们的实际可见元素,以便我可以更好地控制它们的位置。

<script src="http://www.polymer-project.org/platform.js"></script>
<link rel="import" href="http://www.polymer-project.org/components/polymer/polymer.html">
<link href="http://www.polymer-project.org/components/paper-slider/paper-slider.html" rel="import">

<polymer-element name="my-element" noscript>
<template>
<style>
:host { font-family: "Helvetica Neue", sans-serif; }
:host .label { min-width: 150px; }
</style>
<div layout horizontal>
<div class="label" self-center>RED</div>
<paper-slider id="honest" pin="true" snaps="true" min="1" max="5" step="1" immediateValue="test"></paper-slider>
</div>
<div layout horizontal>
<div class="label" self-center>GREEN</div>
<paper-slider id="respectful" pin="true" snaps="true" min="1" max="5" step="1" value="1"></paper-slider>
</div>
<div layout horizontal>
<div class="label" self-center>BLUE</div>
<paper-slider id="knowledgeable" pin="true" snaps="true" min="1" max="5" step="1" value="1"></paper-slider>
</div>
<div layout horizontal>
<div class="label" self-center>ORANGE</div>
<paper-slider id="fair" pin="true" snaps="true" min="1" max="5" step="1" value="1"></paper-slider>
</div>
<div layout horizontal>
<div class="label" self-center>PURPLE</div>
<paper-slider id="likeable" pin="true" snaps="true" min="1" max="5" step="1" value="1"></paper-slider>
</div>
</template>
</polymer-element>
<my-element></my-element>

最佳答案

:host paper-slider { margin-top: -1px; margin-bottom:-1px; }

问题是 slider 彼此尽可能靠近。您可以输入负数,但请记住,事情将开始看起来被压扁。

关于css - 样式化 Google Polymer 的纸张 slider 元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26662893/

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