이전 글의 내용을 토대로 박스를 직접 만드는 과제를 받았다. 과제를 하면서 모르는 부분은 구글링하며 새로운 속성들도 알게 되는 시간이었다.
<style>
div {
margin: 0 auto;
padding: 4px 8px;
width: 110px;
height: 40px;
display: flex;
justify-content: center;
align-items: center;
font-size: 1.2rem;
font-weight: bold;
margin-bottom: 20px;
}
div:hover {
cursor: pointer;
}
/* 첫번째 박스 */
div:first-child {
color: white;
background-color: #343f50;
border-top: 1px solid #4a5568;
border-left: 1px solid #4a5568;
box-shadow: 0 0 0 1px #000;
}
/* 두번째 박스 */
div:nth-child(2) {
background: linear-gradient(to left,#824EEC, #4469E9); /* 그라디언트 */
color: #fff;
outline: 2px dashed #dfdfdf; /* 외곽선 사용 */
border-radius: 20px;
}
/* 세번째 박스 */
div:nth-child(3) {
background-color: #fff;
color: #222222;
border: 1px solid #EEEEEE;
border-radius: 0px 20px 20px 20px;
box-shadow: 3px 3px 2px rgba(0, 0, 0, 0.1);
}
</style>
outline
요소midium
none
, dotted
, dashed
, solid
, double
, groove
, ridge
, inset
, outset
등의 값이 있다. 기본값은 none
div {
outline: 2px dotted blue;
outline-offset: 10px;
}