Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"House-like" border in css

I have a div with a simple border:

border: 10px solid #642850; 

div {
  border: 10px solid #642850;
  height: 100px;
  width: 100px;
}
<div></div>

I'm looking to create a shape like this:

Example

What is the best way to achieve this?

like image 701
Sergey Scopin Avatar asked Dec 08 '25 06:12

Sergey Scopin


1 Answers

try this one : http://jsfiddle.net/sachinkk/L5zz1hak/2/

.sq {
  border: 10px solid #642850;
  height: 100px;
  width: 100px;
  position: relative;
  margin-top: 100px;
}
.tl {
  position: absolute;
  top: -33px;
  left: -36px;
  border-left: 10px solid #642850;
  border-top: 10px solid #642850;
  height: 76px;
  width: 76px;
  transform: rotate(45deg);
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  transform-origin: 100% 100%;
}
<div class="sq">
  <div class="tl"></div>
</div>
like image 159
Sachink Avatar answered Dec 10 '25 23:12

Sachink



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!