本文摘自PHP中文网,作者藏色散人,侵删。
css设置不可编辑的方法:1、通过readonly属性规定输入字段为只读实现不可编辑。2、通过disabled属性规定禁用input元素实现不可编辑。
本文操作环境:Windows7系统、HTML5&&CSS3版、Dell G3电脑。
css设置不可编辑:
1、css通过readonly属性规定输入字段为只读实现不可编辑:
1 2 3 4 5 6 7 8 9 10 11 12 13 | <html>
<body>
<form action= "/example/html/form_action.asp" method= "get" >
<p>Name:<input type= "text" name= "email" /></p>
<p>Country:<input type= "text" name= "country"
value= "China" readonly= "readonly" /></p>
<input type= "submit" value= "Submit" />
</form>
<p>请在提交按钮上单击,输入会发送到服务器上名为 "form_action.asp" 的页面。</p>
</body>
</html>
|
效果图:
阅读剩余部分
相关阅读 >>
css怎么实现禁止缩放
html如何用css美化表格
css line-height值为150%或1.5值的区别
为什么使用div+css布局?
css字符间距怎么设置
使用 css 实现一个简单的骨架屏(skeleton screen)
css文本设置主要有哪几项属性
css如何设置粗体
css怎么让图片旋转90度
css外联样式不起作用怎么办
更多相关阅读请进入《css》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » css怎么设置不可编辑