마지막으로 글자가 정중앙에 배치되도록 <a> 태그 안에 text-alignline-height 속성을 적용합니다.

    예제 소스 Exercise/11장/2_navigation/style.css

    a {
        text-decoration: none;
        position: absolute;
        width: 100%;
        height: 100%;
        text-align: center;
        line-height: 50px;
    }
    
    li {
        position: relative;
        float: left;
        width: 100px;
        height: 50px;
        background-color: yellow;
        border: solid 5px red;
        /* text-align: center; */
        /* line-height: 50px; */
    }

     

    그림 11-8 메뉴 버튼의 동작 범위를 넓힘

    신간 소식 구독하기
    뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.