开发者

css shorthand for border

I am using VS 2005 and while editing a css border property,

Visual Studio displays following tooltip

border:[border-style][border-width][border-color]|inherit

which means following is valid

border:solid 2px #000

but as per this shorthand cheat sheet

following is valid shorthand

border:2px solid #000

I googled for "css shorthand border" and browsed 2-3 articles which all point that border:2px solid #000 is valid

in VS2005 css version for validation is 2.1

So I am not sure why VS2005 displays the shorthand in diff开发者_开发技巧erent manner?

Are both approaches correct ?


W3C CSS Validator validates both


The specification only specifies width | style | color. However I've never had any issue using the way shown in Visual Studio. I'd say they are both pretty safe.

http://www.w3.org/TR/CSS2/box.html#border-properties

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜