- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我已经尝试为我和几个伙伴正在进行的元素创建 android 风格的表单。
我已经设法让文本输入字段在我想要的时候改变样式。但我无法让相关标签改变颜色。
这就是我要做的:
您能看到标题和底线是如何变成粉红色的吗?
<html>
<head>
<title>Experementing</title>
<style type="text/css">
@import url(http://fonts.googleapis.com/css?family=Roboto);
body,html
{
font-family: 'Roboto', sans-serif;
}
label
{
font-size: 10px;
color:grey;
}
label:focus
{
color:pink;
}
input
{
border-left: none;
border-top: none;
border-right: none;
border-bottom: solid grey 1px;
color:black;
width:150px;
height:auto;
background: rgba(0,0,0,0);
}
/*Changes style when input box is clicked*/
input:focus, textarea:focus, isindex:focus, keygen:focus, select:focus
{
border-left: none;
border-top: none;
border-right: none;
border-bottom: solid pink 2px;
outline: none;
}
:focus
{
color:pink;
}
/*removes the glow from auto form fill*/
input:-webkit-autofill
{
-webkit-box-shadow:0 0 0 50px white inset; /* Change the color to your own background color */
-webkit-text-fill-color: #333;
}
input:-webkit-autofill:focus
{
-webkit-box-shadow: /*your box-shadow*/,0 0 0 50px white inset;
-webkit-text-fill-color: #333;
}
</style>
</head>
<body>
<form>
<div style="float:left;">
<label for="username">Username<br/>
<input type="text" name="Name" id="username"/></label>
</div>
<div style="float:left; margin-left:10px;">
<label for="pass">Password</label><br/>
<input type="password" name="Nickname" id="pass"/>
</div>
<input type="submit" value="" name="login" style="background: url(sent.svg); border:none; background-size: cover cover; width:25px; height:25px;" />
</form>
</body>
</html>
最佳答案
把你的 <label>
在你的 <input>
之后然后使用 CSS 兄弟选择器 ~
.然后你需要移动<label>
视觉上回到上方 <input>
与 top:-4em;
.
jsFiddle:http://jsfiddle.net/c37eA/
截图:http://i.imgur.com/S3NDLcz.png
如果您不想更改输入颜色(例如,您希望“Blah”为黑色而不是粉红色),请删除规则:
:focus
{
color:pink;
}
关于Android 样式表单 - 我对样式标签有疑问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25108644/
就在几周前,Google 更改了 Android LVL API(许可证验证库)。 在旧 LVL 中,许可证检查基于使用基于每个帐户生成的公钥/私钥进行的许可证验证。新的假设是对每个应用程序库使用公钥
我在代码中创建了下面的两个类,我不确定我是否以正确的 oop 方式创建了它。我将几何类和顶点设置为两个不同的类,或者它们可以是一个父亲和一个 child ,这很好吗?另一个问题是当我调用几何显示方法时
我正在尝试使用 POST 将变量从 try.htm 传递到 chat.php try.htm 的代码是: function yo() { var text = $("#m
我从未使用过代码源控制系统,我从 GitHub 开始,它看起来很棒! 我阅读了指南,我想我可以很好地理解它是如何工作的,而且我已经在使用它了,但我不清楚一些事情:GitHub 是否会自动将原始存储库中
我有这个函数insert() 该函数在表users中插入数据并发送电子邮件。 我需要在创建另一个状态之前终止前一个状态,对吗?因此,我需要将激活链接存储在另一个表中,即 activationLinks
目前正在为差异模块使用带有差异模式的 postgres。现在我计划切换到 oracle。但我听说在 oracle 模式中不存在..是真的吗..如果是这样我该如何迁移? 最佳答案 在 Oracle 中,
我有以下父对象: Context = { ContextModel: Backbone.Model.extend({ //model Code }), ContextLi
在 C++ 中,我了解到变量用于数据存储,对象是类的实例。但在 JavaScript 中,我看到人们将变量称为对象。为什么变量在 JavaScript 中被称为对象。我对此感到困惑。 最佳答案 在 j
我正在浏览有关 Play 的帖子! framework 并遇到了一些讨论 ecommerce 的帖子。由于我是两者的初学者,我想做一个练习。我写下了一些用例和一些要求如下。我会想听听您对此的看法,希望
人们说 asList方法将数组转换为列表并且不复制,因此“aList”中的每个更改都会反射(reflect)到“a”中。因此,在“aList”中添加新值是非法的,因为数组的大小是固定的。 但是,asL
我决定使用 React-Router 来管理使用 REACT JS 的 Meteor JS 应用程序的路由。 我已经让 React-Router “以某种方式”工作,但它有一些负面影响,我想在这里解释
Class Carro { String name String marca String matricula } Class CarroMovel{ String pro1 String prop2
我对如何设置我的 SVN 东西有一些疑问。 首先是我的情况:程序员独自处理大部分内容,不需要外部访问(目前)。 我要: 一个快速的 SVN,最好是免费的。 私有(private) 备份友好 比较轻松
我正在用 MVVM 做我的第一个 C# WPF 项目,我有几个问题。 第一,我想从我的模型中列出一些对象,当我点击其中一个时,屏幕上会显示一个表单(或默认情况下创建的表单)。在我的表单中,绑定(bin
我对mysql有疑问。我可以轻松地将字段限制为某些字符,例如姓氏,以及其他字段,例如包含特定事件的迷你日志,我认为该事件不再是 2 页(或更少的字符)。我知道这是一个相当常见的问题,我看到了很多关于这
我正在尝试实现 HDLC 帧格式类型 3,但我对帧的 Octets/Modulo 8 编码有一些疑问。 首先,HDLC帧是否全部以Octets传输? 一个帧的长度是 'n' 个八位字节是什么意思?请举
我正在开发一个 ASP.Net 电子商务应用程序。我使用 ASP.Net Web 表单。当我完成整个应用程序时,我考虑缓存一些数据,以便提高应用程序性能。 (坏主意......我必须从一开始就考虑到这
我知道下面的代码会产生编译错误: class A{ public : virtual void name(){cout(b); //Error : 'A' is an inaccessible bas
我是一名优秀的程序员,十分优秀!