views:

77

answers:

1

i am using border on object. like

.box{
    border-left:solid 1px #000;
    border-right:solid 1px #000;
    border-bottom:solid 1px #000;
    width:50px;
    height:50px;
}

may i write this in shorthand?

+8  A: 

This saves only one line:

border: 1px solid #000;
border-top: 0;
BalusC
And after saving all those characters, you could splash out and use `black` instead of `#000`!
Eric
Indeed, go on and splurge! You deserve it!
Williham Totland
is there not way to write this in 1 line? like we use in margin and padding?
kc rajput
No. Margin/padding doesn't have to suffer from color/style. Consider GZIP if those extra bytes really cares you.
BalusC
@kc rajput : You have shorthand for border-width, which is what difers: `border-width: 0px 1px 1px 1px;` or even `border-width: 0px 1px 1px;` - see http://www.htmldog.com/reference/cssproperties/border-width/ . But no, there is no shorthand for defining what you want with a single line... it would be a huge and confusing line.
ANeves
@ANeves: `border-width` does essentially the same as `border` without color/style. `border: 0px 1px 1px`. You saves 6 characters! Oh, even more if you use `0` instead of `0px`. It's all doable.
BalusC