轻松上手,快乐学习!

CSS 参考手册

CSS 参考手册CSS 浏览器支持CSS 选择器参考手册CSS 函数参考手册CSS 听觉参考手册CSS 网络安全字体CSS 动画相关属性CSS 单位Px/Em 换算CSS 颜色CSS 合法颜色值CSS 默认值参考手册CSS 实体

CSS 属性

align-contentalign-itemsalign-selfallanimationanimation-delayanimation-directionanimation-durationanimation-fill-modeanimation-iteration-countanimation-nameanimation-play-stateanimation-timing-functionbackface-visibilitybackgroundbackground-attachmentbackground-blend-modebackground-clipbackground-colorbackground-imagebackground-originbackground-positionbackground-repeatbackground-sizeborderborder-bottomborder-bottom-colorborder-bottom-left-radiusborder-bottom-right-radiusborder-bottom-styleborder-bottom-widthborder-collapseborder-colorborder-imageborder-image-outsetborder-image-repeatborder-image-sliceborder-image-sourceborder-image-widthborder-leftborder-left-colorborder-left-styleborder-left-widthborder-radiusborder-rightborder-right-colorborder-right-styleborder-right-widthborder-spacingborder-styleborder-topborder-top-colorborder-top-left-radiusborder-top-right-radiusborder-top-styleborder-top-widthborder-widthbottombox-decoration-breakbox-shadowbox-sizingbreak-afterbreak-beforebreak-insidecaption-sidecaret-color@charsetclearclipclip-pathcolorcolumn-countcolumn-fillcolumn-gapcolumn-rulecolumn-rule-colorcolumn-rule-stylecolumn-rule-widthcolumn-spancolumn-widthcolumnscontentcounter-incrementcounter-resetcursordirectiondisplayempty-cellsfilterflexflex-basisflex-directionflex-flowflex-growflex-shrinkflex-wrapfloatfont@font-facefont-familyfont-feature-settingsfont-kerningfont-sizefont-size-adjustfont-stretchfont-stylefont-variantfont-weightgridgrid-areagrid-auto-columnsgrid-auto-flowgrid-auto-rowsgrid-columngrid-column-endgrid-column-gapgrid-column-startgrid-gapgrid-rowgrid-row-endgrid-row-gapgrid-row-startgrid-templategrid-template-areasgrid-template-columnsgrid-template-rowshanging-punctuationheighthyphens@importisolationjustify-content@keyframesleftletter-spacingline-heightlist-stylelist-style-imagelist-style-positionlist-style-typemarginmargin-bottommargin-leftmargin-rightmargin-topmax-heightmax-width@mediamin-heightmin-widthmix-blend-modeobject-fitobject-positionopacityorderoutlineoutline-coloroutline-offsetoutline-styleoutline-widthoverflowoverflow-xoverflow-ypaddingpadding-bottompadding-leftpadding-rightpadding-toppage-break-afterpage-break-beforepage-break-insideperspectiveperspective-originpointer-eventspositionquotesresizerightscroll-behaviortab-sizetable-layouttext-aligntext-align-lasttext-decorationtext-decoration-colortext-decoration-linetext-decoration-styletext-indenttext-justifytext-overflowtext-shadowtext-transformtoptransformtransform-origintransform-styletransitiontransition-delaytransition-durationtransition-propertytransition-timing-functionunicode-bidiuser-selectvertical-alignvisibilitywhite-spacewidthword-breakword-spacingword-wrapwriting-modez-index


CSS border-left-width 属性



实例

设置左边框的宽度:

div {border-left-width: thin;}
亲自试一试 »

下面有更多实例。


定义和用法

border-left-width 属性设置元素的左边框的宽度。

只有当边框样式不是 none 时才起作用。如果边框样式是 none,边框宽度实际上会重置为 0。不允许指定负长度值。

注释: 请始终在 border-left-width 属性之前声明 border-style 属性。元素只有在获得边框之后,才能改变其边框的宽度。

默认值: medium
继承性: no
支持动画: yes. 阅读有关动画的信息 测试一下
版本: CSS1
JavaScript 语法: object.style.borderLeftWidth="5px" 测试一下

浏览器支持

表中的数字表示支持该属性的第一个浏览器版本。

属性
border-left-width 1.0 4.0 1.0 1.0 3.5

语法

border-left-width: medium|thin|thick|length|initial|inherit;

属性值

描述 试一试
medium 默认值。定义中等的左边框。 亲自试一试 »
thin 定义细的左边框。 亲自试一试 »
thick 定义粗的左边框。 亲自试一试 »
length 允许您自定义左边框的宽度。 亲自试一试 »
initial 将此属性设置为其默认值。请参阅 initial 亲自试一试 »
inherit 从其父元素继承此属性。请参阅 inherit

更多实例

实例

设置左边框的宽度为中等:

div {border-left-width: medium;}
亲自试一试 »

实例

设置左边框的宽度为粗:

div {border-left-width: thick;}
亲自试一试 »

实例

将左边框的宽度设置为 1px:

div {border-left-width: 1px;}
亲自试一试 »

实例

将左边框的宽度设置为 15px:

div {border-left-width: 15px;}
亲自试一试 »

相关页面

CSS 教程: CSS 边框

CSS 参考手册: border-left 属性

HTML DOM 参考手册: borderLeftWidth 属性