to use it like this

#mybox{
  border: 1px solid #F1F1F1;
  border-top: 0
}

or

#mybox{
  border-left: 1px solid #F1F1F1; 
  border-right: 1px solid #F1F1F1;
  border-bottom: 1px solid #F1F1F1
}

2 answers

3
points
This was chosen as the best answer

I like to do this:

#mybox{
  border: 1px solid #F1F1F1;
  border-width: 0 1px 1px 1px;   
}

because it's quite obvious and easy to edit (values follow standard CSS shorthand - top right bottom left)

and you can even do this:

#mybox{
      border: 1px solid #F1F1F1;
      border-width: 0 1px 1px;   
    }

Using three values means: top - left and right - bottom

Answered about 7 years ago by Tony Crockford
  • You can even cut it down just a tad more by omitting the width from the first 'border' property since it will get declared by 'border-width' #mybox{ border: solid #F1F1F1; border-width: 0 1px 1px; } Andy Ford about 7 years ago
2
points

I all depends on how often you have to update it or redesign the site.

The first one is the most light-weight and thus is "smarter". The later is somewhat easier to update and more flexible.

I would go with the first one because keeping file size low is so important.

Answered about 7 years ago by Jens Hedqvist