Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

css outline left and right

Tags:

css

Anyway to set css outline only show left and right ? Because I can't use border, I tried but it will make more bad outlook .

.test{
  margin:10px;
  padding:10px;
  width:100px;
  height:10px;
  outline:10px solid #000;
  }
<div class="test"></div>
like image 248
FeelRightz Avatar asked Apr 02 '15 02:04

FeelRightz


People also ask

What does CSS outline do?

An outline is a line that is drawn around elements, OUTSIDE the borders, to make the element "stand out". CSS has the following outline properties: outline-style.


1 Answers

You could possibly achieve this using two box shadows:

div {
  margin: 10px;
  padding: 10px;
  width: 100px;
  height: 10px;
  box-shadow: -5px 0px 0px 0px black, 5px 0px 0px 0px black;
}
<div></div>
like image 62
jbutler483 Avatar answered Sep 22 '22 09:09

jbutler483