Style borderLeftStyle 属性

定义和用法

borderLeftStyle 属性设置或返回元素左边框的样式。

另请参阅:

CSS 教程:CSS Baryad

CSS 参考手册:border-left-style 属性

HTML DOM 参考手册:border 属性

实例

Example 1

Adds a solid left border to the <div> element:

document.getElementById("myDiv").style.borderLeftStyle = "solid";

Try It Yourself

Example 2

Changes the left border style of the <div> element to "dotted":

document.getElementById("myDiv").style.borderLeftStyle = "dotted";

Try It Yourself

Example 3

Returns the left border style of the <div> element:

alert(document.getElementById("myDiv").style.borderLeftStyle);

Try It Yourself

Example 4

Demonstration of all different values:

var listValue = selectTag.options[selectTag.selectedIndex].text;
document.getElementById("myDiv").style.borderLeftStyle = listValue;

Try It Yourself

Syntax

Returns the borderLeftStyle property:

object.style.borderLeftStyle

Sets the borderLeftStyle property:

object.style.borderLeftStyle = value
Value Description
none Defines a borderless border. Default.
hidden Same as "none", except in resolving border conflicts for table elements.
dotted Defines a dotted border.
dashed Defines a dashed border.
solid Defines a solid border.
double Defines two borders. The width of both borders is the same as the value of border-width.
groove Defines a 3D groove border. The effect depends on border-color for the values.
ridge Defines a 3D ridge border. The effect depends on border-color for the values.
inset Defines a 3D inset border. The effect depends on border-color for the values.
outset Defines a 3D outset border. The effect depends on border-color for the values.
initial Sets this property to its default value. See initial.
inherit Inherits this property from its parent element. See inherit.

Technical Details

Default Value: none
Return Value: A string representing the style of the element's left border.
CSS Version: CSS1

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Suporta Suporta Suporta Suporta Suporta