Problem:
We usually put a red star after a field to indicate that this field is required. Of course, we can add a '*' and apply css on it. But it is really unconvenient to do so on everywhere. From the html semantical point of view, it is a info about the input, we do not need to write it explicitly.
Solution:
We can use css to control the place of the information about "required".
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<style>
/*we can use before to display it before the fields*/
.required:after{
content:"*";
color:red;
}
</style>
</head>
<body>
<div class="required">
<input type="text"/>
</div>
</body>
</html>
Try it in jsfiddle
Note:
Unfortunately, we can not apply the css directly on the input element as described here
.
分享到:
相关推荐
hibernate required包hibernate required包hibernate required包hibernate required包
required.js required.js required.js required.js required.js required.js
openfire red5 spark 详细二次开发包,公司内部进行通信的二次开发很好的哦
解决pycharm 需要的c++库,VC_redist.x64,解决microsoft visual c++ 14.0 is required
What jars are required by JCS? As of verison 1.2.7.0, the core of JCS (the LRU memory cache, the indexed disk cache, the TCP lateral, and the RMI remote server) requires only two other jars. ...
redis连接报错error:NOAUTH Authentication required
microsoft visual c++ 14.0 is required问题解决办法
解决Navicat运行报“Missing required library libmysql_d.dll 126”的问题,下载之后放到 Navicat安装目录 下,重新打开程序即可。
在 Windows 安装 python 包经常会遇到这错误: error: Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ Build Tools 遇到这错误不要慌, 进这个网站下载对应的 whl 包即可。 ...
Visual C++ 2008 Redistributable US English Intel x86 IExpress ...This installer database contains the logic and data required to install Microsoft Visual C++ 2008 Redistributable - x86 9.0.21022.
Some assembly required Assembly language programming with the AVR Microcontroller author: Timothy S. Margush
Microsoft visual c++ 14.0 is required问题解决办法
解决“Python version 2.6 required..”的注册表文件,下载后打开文件,修改python安装路径,保存后双击导入就可以了
Microsoft Visual C++ 14.0解决is required 解决安装scrapy时的需要
解决安装某些python包**error: Microsoft Visual C++ 14.0 or greater is required. BUG**报错的文件
在PB插入Microsoft Rich Textbox Control OLE对象时出如下提示:insert of OLE object failed,license file required 用如下文件修改注册表,解决问题。
解决python模块错误c++14.0 is required. microsoft visual c++ 14.0 is required问题解决办法
好书,远程工作必看的书籍,希望对你有帮助,
亲测解决tomcat9.08搭配jkd9,搭建servlet环境。常见问题是,The required Server component failed to start so Tomcat is unable to start。这个问题,直接通过配置eclipse来解决这个问题。
问题解决包,下载他,问题一通百通,一键解决你的烦恼~ 这类错误一般出现在windows环境下,因为windows环境下没有默认安装c的环境。