Loading...
在早期,我们都是通过使用 JavaScript 来实现占位符功能。而现在,HTML5 原生提供的 placeholder 属性让我们在现代浏览器轻松就能实现这样的功能。这里向大家分享一个自适应的占位符效果(Adaptive Placeholder),当你输入的时候,提示文字不会消失,而是以动画的方式移动到了输入框的上方。HTML:<div style="width:400px...
HTML5提供了地理位置定位功能(Geolocation API),能确定用户位置,我们可以借助HTML5的该特性开发基于地理位置信息的应用。本文结合实例给大家分享如何使用HTML5,借助百度、谷歌地图接口来获取用户准确的地理位置信息。如何使用HTML5地理位置定位功能定位功能(Geolocation)是HTML5的新特性,因此只有在支持HTML5的现代浏览器上运行,特别是手持设备如ipho...
HTML4中的input类型HTML4中的一些常用的类型button:定义可点击的按钮(大多与 JavaScript 使用来启动脚本)checkbox:定义复选框file:定义输入字段和 "浏览..." 按钮,供文件上传hidden:定义隐藏输入字段image:定义图像作为提交按钮password:定义密码字段。字段中的字符会被遮蔽。radio:定义单选按钮reset:定义重置按钮:重置按钮...
一、meta标签的定义meta标签是head部的一个辅助性标签,提供关于 HTML 文档的元数据。它并不会显示在页面上,但对于机器是可读的。可用于浏览器(如何显示内容或重新加载页面),搜索引擎(SEO),或其他 web 服务。二、meta标签的作用meta标签里的数据是供机器解读的,其主要作用有:搜索引擎优化(SEO),定义页面使用语言,自动刷新并指向新的页面,实现网页转换时的动态效果,控制...
使input文本框不可编辑的3种方法,现在总结一下:方法一:disabled 属性规定应该禁用 input 元素,被禁用的 input 元素,不可编辑,不可复制,不可选择,不能接收焦点,后台也不会接收到传值。设置后文字的颜色会变成灰色。disabled 属性无法与 <input type="hidden"> 一起使用。示例: <input typ...