[CSS] div보다 작은 border 만들기 (Make border smaller than div length)

div보다 작은 border 만들기

div {
  width   : 200px;
  height  : 50px;   
  position: relative;
  z-index : 1;
}

div:before {
  content : "";
  position: absolute;
  left    : 0;
  bottom  : 0;
  height  : 1px;
  width   : 50%;  /* or 100px */
  border-bottom:1px solid magenta;
}

pseudo 클래스로 넣어주면 된다.

refer

http://stackoverflow.com/questions/8572952/border-length-smaller-than-div-width

Published by

Yurim Jin

아름다운 웹과 디자인, 장고와 리액트, 그리고 음악과 맥주를 사랑하는 망고장스터

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s