placeholder

疯狂的表单-html5新增表单元素和属性

做~自己de王妃 提交于 2020-01-03 07:03:12
疯狂的表单 2015/11/27 16:44:07 从三方面来介绍html5表单的新特性 表单结构更灵活 要提交数据的控件可以布局在form标签之外,看下面的代码,表单元素可以写到form元素之外,只需在元素中加入form="form1"属性,也可提交到form元素指定的服务器地址 <body> <form action="upload.php" method="post" accept-charset="utf-8" id="form1"> </form> <input type="text" name="username" value="" form="form1"> <input type="submit" name="sub" value="提交" form="form1"> </body> 新增表单元素 我们以前学过的表单元素包括“text”、“button”、“file”、"radio"等,html5中新增加了一些表单元素,下面列出这些元素及其作用 email 类型用于验证email的格式,当提交表单时会自动验证email域的值 url 类型用于验证 URL 地址的格式,当提交表单时会自动验证url域的值 number 类型会根据你的设置提供选择数字的功能,min属性设置最小值、max属性设置最大值,value属性设置当前值,step属性设定每次增长的值

flex space-between最后一行对齐问题的解决方案

随声附和 提交于 2020-01-03 01:20:46
背景 常见的一个图文列表设计,通常是这样的,两端顶着容器,中间的间距平均分,如下图的某东商品列表的设计: 列表是这样自适应的,当视窗足够放多少个商品就放多少个,然后各个商品项目之间的间距平均分。由于每个人的视窗都可能不同,因此所看到的间距或者每一行的个数都会不同。 方案 想到这种设计,我们学过flex就知道,非常像flex的justify-content: space-between的效果,因此我们自然这样实现: .flex { list-style: none; margin: 0; padding: 0; box-sizing: border-box; display: flex; flex-wrap: wrap; justify-content: space-between; } .demo1 > .flex__item { flex-basis: 200px; margin-top: 1rem; text-align: center; box-sizing: border-box; } .demo1 > .flex__item img { width: 100%; } <ul class="flex demo1"> <li class="flex__item"> <img src="http://via.placeholder.com/100" /> <p> 图片 </p>

How to display placeholder's text in HTML5's number-typed input

*爱你&永不变心* 提交于 2020-01-02 01:41:31
问题 Is there a way I can show placeholder text inside an input tag of type=number? Detailed Q: The property 'placeholder' of an HTML's input tag is used to show description about the input tag in the UI when the element is not focused - the descriptive text goes blank when the same field gets focus. The problem is no text is visible if the input type is made of type="number". I do have space limitations in my UI and cannot afford a label before the input tag. Any suggestions? 回答1: Placeholders

JQuery placeholder HTML5 simulator

允我心安 提交于 2020-01-01 18:56:21
问题 I have been using the HTML 5 placeholder and just realised that it does not work outside HTML5 devices. As you can see by the code below the placeholder is always in lowercase and the value is always in upper case. #maphead input::-webkit-input-placeholder { text-transform:lowercase; } #maphead input:-moz-placeholder { text-transform:lowercase; } <input id="start" type="text" spellcheck="false" placeholder="enter your post code" style="text-transform:uppercase;" class="capital"/> This is all

Form 表单提交

会有一股神秘感。 提交于 2020-01-01 11:54:04
简单方法(1) #!/usr/bin/env python # -*- coding:utf-8 -*- import tornado.ioloop import tornado.web import re class MainForm(object): def __init__(self): self.host = "(.*)" self.ip = "^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$" self.port = '(\d+)' self.phone = '^1[3|4|5|8][0-9]\d{8}$' def chec_inpu(self,handler): exits = True inp_dict = {} for key,value in self.__dict__.items(): user_input = handler.get_argument(key) res = re.match(value,user_input) if not res: exits = False inp_dict[key] = user_input return exits,inp_dict class MainHandler(tornado.web.RequestHandler): def

placeholder text in zend text element

一笑奈何 提交于 2020-01-01 08:54:27
问题 I am working on a Zend form application where my form contains text boxes with watermarks. we can achieve this in HTML by the following code: <input type="text" placeholder="Search" name="q" /> My question is how to add the placeholder attribute in my input-box using Zend form ? 回答1: It's already been mentioned to use: $element->setAttrib('placeholder', 'Search'); You can also use it like this when extending Zend_Form $element = $this->createElement('text', 'q', array( 'placeholder' =>

placeholder text in zend text element

孤街醉人 提交于 2020-01-01 08:54:26
问题 I am working on a Zend form application where my form contains text boxes with watermarks. we can achieve this in HTML by the following code: <input type="text" placeholder="Search" name="q" /> My question is how to add the placeholder attribute in my input-box using Zend form ? 回答1: It's already been mentioned to use: $element->setAttrib('placeholder', 'Search'); You can also use it like this when extending Zend_Form $element = $this->createElement('text', 'q', array( 'placeholder' =>

placeholder的样式设置

爷,独闯天下 提交于 2019-12-31 06:06:50
在input框中有时想将输入的字和placeholder设为不同的颜色或其它效果,这时就可以用以下代码来对placeholder进行样式设置了。 ::-webkit-input-placeholder{} /* 使用webkit内核的浏览器 */ :-moz-placeholder{} /* Firefox版本4-18 */ ::-moz-placeholder{} /* Firefox版本19+ */ :-ms-input-placeholder{} /* IE浏览器 */ 注1:冒号前写对应的input或textarea元素等。 注2:placeholder属性是css3中新增加的属性,IE9和Opera12以下版本的CSS选择器均不支持占位文本。 eg: css代码 #input-test{ color: #FFC0CB; font-size: 1.2em; width: 180px; height: 36px; } #input-test::-webkit-input-placeholder{ color: #ADD8E6; } #input-text::-moz-placeholder{ //不知道为何火狐的placeholder的颜色是粉红色,怎么改都不行,希望有大牛路过帮忙指点 color: #ADD8E6; } #input-text:-ms-input

Firefox Placeholder Before CSS selector not working

社会主义新天地 提交于 2019-12-31 05:26:13
问题 I'm using the latest firefox 30.0. I'm trying to insert a red font awesome star before the placeholder of required fields. I got this working in Chrome no problem but I'm having issues with FF and. Here's a codepen illustrating my issue - http://codepen.io/anon/pen/BLibw My markup: <input placeholder="Address" data-required required id="id_street" name="street" type="text" /> My CSS(sass): [data-required] { &::-webkit-input-placeholder::before { font-family: fontAwesome; content:'\f005 ';

ASP.NET dynamically adding UserControl to PlaceHolder, not fire Click Event, only Page_Load

亡梦爱人 提交于 2019-12-31 05:01:09
问题 In my ASP.Net page I have PlaceHolder and Button. When user click on this button, I add some UserControls from my Interface method getControl to the PlaceHolder. Code: protected void ActionBtn_Click(object sender, EventArgs e) { if (provider != null) { actualObject = (PlaceHolder)provider.getControl(); PlaceHolder1.Controls.Add(actualObject); } } Method getControl: public object getControl() { ph = new PlaceHolder(); exportInbBtn = new Button(); exportInbBtn.Text = "Export Inventury";