border 의 color를 text의 color와 같게 설정하기

If an element’s border color is not specified with a border property, user agents must use the value of the element’s ‘color’ property as the computed value for the border color..

border 속성에  색상정보를 넣지 않으면   텍스트 color 속성의 정보를 이용한다.

  1. 축약식일때는  색상 정보만 뺀다.
    .myDiv {
         color: green;
         border: 1px solid; /* 색상정보가 빠져있음
         border:1px solid green; 과 같다. */
     }
  2. 축약식이 아닐때는  border-style과 border-width만 설정하고 border-color는 빼면된다.
    .myDiv {
        color: green; 
        bottom-style: dotted; 
        border-bottom-width: 1px;
        /* border-color: green; 이설정은 뺀다 */
    }

http://www.w3.org/TR/CSS21/box.html#border-color-properties

Total Views: 474 ,

답글 남기기

이메일은 공개되지 않습니다. 필수 입력창은 * 로 표시되어 있습니다.