border在html中是边框的意思。border是一个边框属性,可以在一个声明中设置所有边框样式,语法为【Object.style.border=borderWidth borderStyle borderColor】。

本教程操作环境:windows7系统、html5版,DELL G3电脑。
border在html中是边框的意思。
border 属性在一个声明中设置所有边框属性。
语法:
立即学习“前端免费学习笔记(深入)”;
Object.style.border=borderWidth borderStyle borderColor
实例
本例改变元素的边框:
<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>
相关学习推荐:html视频教程











