对聚合物Web组件进行样式化

编程入门 行业动态 更新时间:2024-10-23 21:34:03
本文介绍了对聚合物Web组件进行样式化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何设计或重构此列表,以便复选框的可点击区域不会相互干扰? 是否有分组容器我不知道?

How would you go about styling or refactoring this list, so that the clickable areas of the checkboxes do not interfere with each other? Is there a grouping container I am not aware of?

<div layout vertical> <div layout horizontal> <paper-checkbox></paper-checkbox> <paper-item label="item 1"></paper-item> </div> <div layout horizontal> <paper-checkbox></paper-checkbox> <paper-item label="item 2"></paper-item> </div> <div layout horizontal> <paper-checkbox></paper-checkbox> <paper-item label="item 3"></paper-item> </div> </div>

复选框应与纸张项目的标签(如图标按钮中的图标)当然不会干扰对方或项目。

The checkboxes should be neatly aligned with the paper-item's label (like icons in an icon-button) and of course not interfering with each other or the item.

到目前为止,我没有使用任何css为我的原型,现在复选框是打破了一切。 p>

So far I didn't have to use any css for my prototype and now checkboxes are breaking everything.

推荐答案

一点点填充就是诀窍:

<style> #container > div { padding: 12px; } </style> <div layout vertical id="container"> <div layout horizontal center> ... </div> <div layout horizontal center> ... </div> ... </div>

我也使用了 center 属性

演示: jsbin/pobiyawu/1/edit

更多推荐

对聚合物Web组件进行样式化

本文发布于:2023-08-02 17:56:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1279906.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:聚合物   样式   组件   Web

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!