我正在尝试添加颜色的选择输入。我想要添加为选项的颜色如下:http://ionicframework.com/docs/components/#header 如何编写选择,以便在用户选择颜色时,他将选项视为颜色而不是颜色名称?
这就是我现在所拥有的,在浏览器中运行时可以接受,但是当我从手机运行时,背景颜色不可见,用户只能看到颜色的名称:
<select ng-model="category.colour" required> <option selected style="background-color: white" class="light">light</option> <option style="background-color: cornsilk" class="stable">stable</option> <option style="background-color: DodgerBlue " class="positive">positive</option> <option style="background-color: aqua" class="calm">calm</option> <option style="background-color: YellowGreen" class="balanced">balanced</option> <option style="background-color: Gold" class="energized">energized</option> <option style="background-color: Crimson " class="assertive">assertive</option> <option style="background-color: BlueViolet " class="royal">royal</option> <option style="background-color: black" class="dark">dark</option> </select>