html中如何去掉文本框的边框

html中如何去掉文本框的边框,第1张

可以用border属性去除文本框边框

1、新建html文档,在body标签中添加一些input标签,这时默认情况下浏览器中的文本框有1px的边框:

2、在head标签中添加style标签,设置input的样式,这里为了演示方便,为文本框设置灰色的背景色:

3、为input标签设置边框“border”属性,属性值为“0”,这时网页中文本框的边框就被去掉了:

html中去掉表格边框线

border="0"可以去除边框以下是关于border的一些相关资料:定义和用法border 属性在一个声明中设置所有边框属性。语法:Object.style.border=borderWidth borderStyle borderColorborderWidth设置边框的宽度。thinmediumthicklengthborderStyle设置边框的样式。nonehiddendotteddashedsoliddoublegrooveridgeinsetoutsetborderColor设置边框的颜色。color-namecolor-rgbcolor-hextransparent实例本例改变元素的边框:<html><head><style type="text/css">p{ border: thin dotted #FF0000}</style><script type="text/javascript">function changeBorder(){document.getElementById("p1").style.border="thick solid #0000FF"}</script></head><body><input type="button" onclick="changeBorder()"value="Change border" /><p id="p1">This is a paragraph</p></body></html>


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/6120130.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-03-15
下一篇2023-03-15

发表评论

登录后才能评论

评论列表(0条)

    保存