placeholder

我的不可能这么可爱

◇◆丶佛笑我妖孽 提交于 2019-11-28 15:54:22
作者:陈大鱼头 github:KRISACHAN <input /> 标签是我们日常开发中非常常见的替换元素了,但是最近在刷 whattwg 跟 MDN 的时候发现 跟 <input /> 有很多相关的属性,选择器都没怎么用过,所以就开篇文章来整理一下一些比较有趣或者实用的知识点。 本篇文章默认大家已经知道 <input /> 标签的基本用法,不会做过多的基础说明~ 没想到,这些选择器居然跟 input … 到写文章为止,根据最新的 drafts 指出,一共有3大类,16种跟 input 相关的选择。其实都挺有用的,善用它们,会让我们的用户体验更加美好。 下面我们来分享一下这3大类选择器的作用: 第一类:控制系(Input Control States) 选择器 作用 :enabled 选择可使用状态的 <input /> 元素 :disabled 选择不可使用状态的 <input /> 元素 :read-only 选择不可编辑状态的元素(不仅仅是 <input /> ) :read-write 选择可编辑状态的元素(不仅仅是 <input /> ) :placeholder-shown 选择 placeholder text 显示时的元素 :default 选择在 <button> , <input type="checkbox" /> , <input type="radio"

Python placeholders in strings containing the % symbol

折月煮酒 提交于 2019-11-28 14:39:46
I want to be able to use a placeholder in a string that already contains a % symbol. For instance, I would like to be able to iterate to open multiple URLs by my URL already contains a % symbol, example url: http://www.example.com/BLABLA%123BLABLApage=1 To do so, I want to replace the number 1 by a placeholder ( %d ), but the code seems to be confused by the presence of the % that comes before the placeholder. You can escape % by doubling it: >>> 'http://www.example.com/BLABLA%%123BLABLApage=%d' % (1,) 'http://www.example.com/BLABLA%123BLABLApage=1' Alternatively, use str.format() formatting

重新学习Vue_01_watch computed

走远了吗. 提交于 2019-11-28 13:50:47
1 <template> 2 <div> 3 <label>姓:<input type="text" placeholder="请输入姓氏" v-model="firstName"></label> 4 <p></p> 5 <label>名:<input type="text" placeholder="请输入名字" v-model="lastName"></label> 6 7 <p>-----------------------------------------------------------------------</p> 8 <!--单向--> 9 <label>姓 名:<input type="text" placeholder="请输入姓名" v-model="fullNameOne"></label> 10 <p></p> 11 <!--双向--> 12 <label>姓 名:<input type="text" placeholder="请输入姓名" v-model="fullNameTwo"></label> 13 <p></p> 14 <!--双向--> 15 <label>姓 名:<input type="text" placeholder="请输入姓名" v-model="fullNameThree"></label> 16 </div> 17 <

PHP's PDO prepared statement: am I able to use one placeholder multiple times? [duplicate]

亡梦爱人 提交于 2019-11-28 13:01:14
This question already has an answer here: PDO Parameterized Query - Reuse named placeholders? 4 answers I'd like to perform the following query: SELECT *, (SELECT COUNT(*) FROM `tab2` WHERE `parent` = :id ) AS `sum` FROM `tab1` WHERE `id` = :id As you can see :id placeholder appeared twice in the query. So if I'd try to execute this statement with: $q->execute(['id'=>$row_id]); I'm receiving the error: Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY093]: Invalid parameter number So I have to rewrite the prepared query and execute array with :id1 and :id2 placeholders

overriding placeholder font css in all browsers

南楼画角 提交于 2019-11-28 12:42:46
I am trying to override the font of all headers, input, select, text area and input placeholders on my site with the following code: h1, h2, h3, h4, h5, h6, button, input, select, textarea, :-ms-input-placeholder, ::-moz-placeholder, :-moz-placeholder, ::-webkit-input-placeholder { font-family:some font name; } The problem is, for some reason it isn't working on Chrome. If I delete the :-moz and :-ms references, then chrome works fine, which leads me to believe that Chrome doesn't like pseudo-classes for some reason? I'm stumped, because I can't see why pseudo-classes that have nothing to do

TensorFlow非线性回归--基于神经网络算法

北战南征 提交于 2019-11-28 12:15:59
import tensorflow as tf import numpy as np import matplotlib.pyplot as plt """ 1. shape: 矩阵维度 3*2 =================== 2. [None,1]: N行 1列 =================== 3. numpy.random.normal(loc=0.0, scale=1.0, size=None) 正态分布 loc:float 此概率分布的均值(对应着整个分布的中心centre) scale:float 此概率分布的标准差(对应于分布的宽度,scale越大越矮胖,scale越小,越瘦高) size:int or tuple of ints 输出的shape,默认为None,只输出一个值 """ xdata = np.linspace(-0.5, 0.5, 200)[:,np.newaxis] # 后面增加维度 noise = np.random.normal(0, 0.02, xdata.shape) # 加噪音,但要 保证和xdata的维度一致 ydata = np.square(xdata) + noise # y=x^2+noise # ydata=np.exp(xdata)+noise # 定义两个placeholder x = tf

CNN-简单图片分类

浪尽此生 提交于 2019-11-28 11:19:50
原文链接: https://www.dazhuanlan.com/2019/08/17/5d577456ecc9a/ 假期的时候跟着专知的一个深度学习课程学习了一些深度学习的内容,也是愈发觉得神经网络十分神奇,最近看了一份简单的图片分类的CNN网络,记录学习一下,从简单学起~ 大部分神经网络的基础就不再写了,网上也有很多介绍,这里就照着代码,顺一遍基本的使用方法~ 简略介绍 训练样本50张,分为3类: 0 => 飞机 1 => 汽车 2 => 鸟 图片都放在data文档夹中,按照label_id.jpg进行命名,例如2_111.jpg代表图片类别为2(鸟),id为111。 导入相应库 12345678 import osfrom PIL import Image#矩阵运算库import numpy as npimport tensorflow as tf 读取数据 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 # 数据文档夹data_dir = "data"test_data_dir = "test_data"# 训练还是测试,true为训练train = False# 模型文档路径model_path = "model/image_model"

input[type=number] placeholder color in FF29+

霸气de小男生 提交于 2019-11-28 09:58:57
<input type="text" placeholder="test" /> <input type="number" placeholder="test" /> How do I style it? :-moz-placeholder { color: red; opacity: 1; } ::-moz-placeholder { color: red; opacity: 1; } Why doesn't the global placeholder work on it, even though firebug shows it's applied? Is it a bug, is it an intention? http://jsbin.com/papad/1/edit?html,css,output It's apparently a bug: Firefox 29.0 the ::-moz-placeholder css pseudo-element selector is not honored for with type="number" However, it seems to actually work for some users... 来源: https://stackoverflow.com/questions/23512846/inputtype

jQuery change placeholder text color

烂漫一生 提交于 2019-11-28 08:58:48
Is it possible to use "::-webkit-input-placeholder" with jQuery to set a color for the placeholder text? Something like this: $("input::-webkit-input-placeholder").css({"color" : "#b2cde0"}); Blender You can't really modify pseudo-selectors with JavaScript. You'll have to modify an existing a <style> element . If possible, make a class: .your-class::-webkit-input-placeholder { color: #b2cde0 } And add it to the element: $('input').addClass('your-class'); If you don't have a stylesheet , and want to inject CSS dynamically you can use the following: $('body').append('<style>.my_class:

placeholder for input type date html5

半城伤御伤魂 提交于 2019-11-28 08:22:40
问题 placeholder does not work for input type date directly. <input required="" type="text" class="form-control" placeholder="Date"/> instead, it shows mm/dd/yyy how to show Date ? 回答1: use onfocus="(this.type='date')" , example: <input required="" type="text" class="form-control" placeholder="Date" onfocus="(this.type='date')"/> 回答2: use onfocus and onblur... Here it's an example: <input type="text" placeholder="Birth Date" onfocus="(this.type='date')" onblur="if(this.value==''){this.type='text'}