在线文档教程
CSS

-moz-outline-style

-moz-outline-style

outline-styleCSS属性用于设置元素的外形风格。一个轮廓线是围绕着一个元素在border外面画的线。

outline定义轮廓的外观时使用简写属性通常更为方便。

/* Keyword values */ outline-style: auto; outline-style: none; outline-style: dotted; outline-style: dashed; outline-style: solid; outline-style: double; outline-style: groove; outline-style: ridge; outline-style: inset; outline-style: outset; /* Global values */ outline-style: inherit; outline-style: initial; outline-style: unset;

初始值none
适用元素all elements
是否是继承属性no
适用媒体visual, interactive
计算值as specified
动画类型discrete
正规顺序the unique non-ambiguous order defined by the formal grammar

语法

outline-style属性被指定为下面列出的任何一个值。

没有使用大纲。outline-width0.dotted

大纲是一系列dots.dashed

轮廓是一系列的短线segments.solid

轮廓是单一的line.double

轮廓是两条单线。outline-width的两条线是它们之间距离的总和。

大纲看起来好像被雕刻在page.ridge中

相反的groove:轮廓看起来像是从page.inset中挤出的

大纲使框看起来好像嵌入在page.outset中

相反的inset:大纲使方框看起来像是从页面中出来的。

正式语法

auto | <br-style>where <br-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset

例1-dotted和dashed

HTML

<div> <div class="dotted"> <p class="dashed">Outline Demo</p> </div> </div>

CSS

.dotted { outline-style: dotted; /* same result as "outline: dotted" */ } .dashed { outline-style: dashed; } /* To make the Demo clearer */ * { outline-width: 10px; padding: 15px; }

例2-solid和double

HTML

<div> <div class="solid"> <p class="double">Outline Demo</p> </div> </div>

CSS

.solid { outline-style: solid; } .double { outline-style: double; } /* To make the Demo clearer */ * { outline-width: 10px; padding: 15px; }

例3-groove和ridge

HTML

<div> <div class="groove"> <p class="ridge">Outline Demo</p> </div> </div>

CSS

.groove { outline-style: groove; } .ridge { outline-style: ridge; } /* To make the Demo clearer */ * { outline-width: 10px; padding: 15px; }

例4-inset和outset

HTML

<div> <div class="inset"> <p class="outset">Outline Demo</p> </div> </div>

CSS

.inset { outline-style: inset; } .outset { outline-style: outset; } /* To make the Demo clearer */ * { outline-width: 10px; padding: 15px; }

规范

SpecificationStatusComment
CSS Basic User Interface Module Level 3The definition of 'outline-style' in that specification.Candidate RecommendationAdded auto value.
CSS Level 2 (Revision 1)The definition of 'outline-style' in that specification.RecommendationInitial definition.

浏览器兼容性

FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support1.0(Yes)1.5 (1.8)18.07.01.2 (125)
auto?No support????

FeatureAndroidEdgeFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Basic support2.1(Yes)46.0 (46)10123.2
auto?No support????