尽管使用了-moz-placeholder属性,但我的文本输入占位符拒绝在IE和Firefox中显示.如果您使用的是Firefox或IE,可以在此处的联系页面上查看.
有人可以请帮助我一直试图解决这个问题几周.我的代码示例如下:
input::-moz-placeholder, textarea::-moz-placeholder {
color: #aaa;
font-size: 18px;
}
input:-ms-input-placeholder, textarea::-ms-input-placeholder {
color: #aaa;
font-size: 18px;
}
input::-webkit-input-placeholder, textarea::-webkit-input-placeholder {
color: #aaa;
font-size: 18px;
}
Run Code Online (Sandbox Code Playgroud) 在Edge Browser上,我无法更改输入占位符颜色.
:-ms-input-placeholder不工作但在IE 10&上工作正常IE 11.
input:-ms-input-placeholder {
font-style:italic;
color: red;
background-color: yellow;
}
Run Code Online (Sandbox Code Playgroud)
反正有没有使用CSS?
我有一个表单,在表单中有一个text_field_tag.它写成这个......
<%= text_field_tag "search", :placeholder => 'Enter search term...' %>
Run Code Online (Sandbox Code Playgroud)
但是,当生成HTML时,这将返回页面源...
<input id="search" name="search" type="text" value="{:placeholder=>"Enter search
term..."}" />
Run Code Online (Sandbox Code Playgroud)
为什么这样做以及如何修复它以使占位符有效?
{{ Form::text('username', Input::old('username')) }}
Run Code Online (Sandbox Code Playgroud)
这是我的代码,我想在文本框中添加Username作为占位符.我已经在项目中使用了bootstrap.
我试着用这个例子
{{ Form::text('username', 'Username', Input::old('username')) }}
Run Code Online (Sandbox Code Playgroud)
但是它提供了一个需要删除的默认值,然后用户必须输入他的值.我想要它在Twitter.com等上显示的内容.一旦用户输入内容,它就会被删除.
我有以下输入html元素,我想根据我的用户模型中的内容更改占位符.
<input type="text" class="form-control" id="Username" name="Username" data-ng-model="user.Username" required="" ng-placeholder="{{user.AdAccount ? 'Username' : 'Ad Login'}}">
Run Code Online (Sandbox Code Playgroud)
我甚至试过这种方法,据说在以前版本的角度有效,但没有成功.
ng-placeholder="user.AdAccount == true && 'Username' || 'AD Login'"
Run Code Online (Sandbox Code Playgroud)
目前我的占位符显示为完全空白.我也知道AdAccount正确地保存了true/false,因为它正在使用ng-show在表单的其他地方使用.
这是代码隐藏在文件Page_Load事件后面的代码:
LinkButton linkButton = new LinkButton();
linkButton.ID = "LinkButtonDynamicInPlaceHolder1Id" + i;
linkButton.ForeColor = Color.Blue;
linkButton.Font.Bold = true;
linkButton.Font.Size = 14;
linkButton.Font.Underline = false;
linkButton.Text = itemList[i].ItemTitle.InnerText;
linkButton.Click += new EventHandler(LinkButton_Click);
linkButton.Attributes.Add("LinkUrl",itemList[i].ItemLink.InnerText);
PlaceHolder1.Controls.Add(linkButton);
Label label = new Label();
label.ID = "LabelDynamicInPlaceHolder1Id" + i;
label.ForeColor = Color.DarkGray;
label.Text = itemList[i].ItemDescription.InnerText;
PlaceHolder1.Controls.Add(label);
Run Code Online (Sandbox Code Playgroud)
我想在生成的每个控件之间换行.
我从数据库中取出一个电话号码,当用户开始在文本字段中编辑以更改该电话号码时,我想使用我当前在数据库中的号码作为占位符.由于此信息随每个用户而变化,我如何在swift中以编程方式设置它?
在Xcode 11 Beta版本和iOS 13模拟器中,访问TextField _placeholderLabel.textColor标签键时会崩溃。
用于应用占位符文本颜色的键。
[textfield setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];
Run Code Online (Sandbox Code Playgroud)
“ NSGenericException”-原因:“禁止访问UITextField的_placeholderLabel ivar。这是一个应用程序错误”
在我的图像上,我设置了onerror属性,以便在图像由于某种原因不可用时使用占位符:
<img
class="article-img"
src="path-to-image.jpg"
alt="some description"
onerror="this.src='/images/fallback.png'"
>
Run Code Online (Sandbox Code Playgroud)
现在,它看起来onerror 已被弃用,但我找不到任何关于处理错误的建议替代方法的好的来源(可能以类似的紧凑方式)。
知道为什么它被弃用也会很有趣。
placeholder ×10
html ×4
uitextfield ×3
css ×2
swift ×2
angularjs ×1
asp.net ×1
button ×1
dynamic ×1
fallback ×1
image ×1
ios ×1
ios13 ×1
laravel ×1
laravel-4 ×1
line-breaks ×1
objective-c ×1
xcode11 ×1