1
Here is my jsBin。ポリマー1.x:スタイリングペーパー入力幅およびインライン
paper-input
をpaper-menu
とインラインで入れたいと思います。しかし、以下の試みでは、paper-input
はblock
と書かれています。どのように私はそれをinline
のスタイルにしますか?私はまた、100%
の代わりにpaper-input
の幅を25px
にします。これをどのように達成するのですか?
あなたの答えに作業コードの例を記入してください。
http://jsbin.com/mufuzodife/1/edit?html,output<!doctype html>
<head>
<meta charset="utf-8">
<base href="https://polygit.org/components/">
<script src="webcomponentsjs/webcomponents-lite.min.js"></script>
<link href="polymer/polymer.html" rel="import">
<link href="paper-menu/paper-menu.html" rel="import">
<link href="paper-item/paper-item.html" rel="import">
<link href="paper-input/paper-input.html" rel="import">
</head>
<body>
<dom-module id="x-element">
<template>
<style>
.inline, paper-item, paper-input {
display: inline;
}
paper-input, --paper-input-container {
width: 25px;
}
</style>
<div class="inline">
<paper-menu class="inline">
<paper-item>Item 1</paper-item>
<paper-item>Item 2</paper-item>
</paper-menu>
<paper-input label="text input"></paper-input>
</div>
</template>
<script>
(function(){
Polymer({
is: "x-element",
properties: {},
});
})();
</script>
</dom-module>
<x-element></x-element>
</body>
あなたは 'mixin'を間違って使用しています。 'mixins'は他のcssプロパティと同じように使用されます。例えば、名前と値を区切る'コロン(:) 'やプロパティの最後に'セミコロン(;) 'を使用します。 'paper-input { - ペーパー入力コンテナ:{width:25px;}; } ' – a1626