2013-08-23 5 views
2

수 서리 격자에 맞는 기본 탐색과 같은 안드로이드를 만들고 싶습니다. 그것은 다음과 같습니다수 시티 그리드가있는 가로 목록

enter image description here

코드는 여기 간다 :

HTML :

<div class="container"> 
    <nav> 
     <ul class="horizontal-list"> 
      <li> 
       <a href="#">One</a> 
      </li> 
      <li> 
       <a href="#">Two</a> 
      </li> 
      <li> 
       <a href="#">Three</a> 
      </li> 
      <li> 
       <a href="#">Four</a> 
      </li> 
     </ul> 
    </nav> 
</div> 

SASS :

header.main { 
    height: $headerHeight; 
    background: url('images/headerBackground.gif'); 

    .container { 
     @include container; 
     @include susy-grid-background; 

     nav { 
      @include span-columns(8); 

      ul.horizontal-list { 
       @include horizontal-list; 
       overflow: visible; 

       li { 
        @include isolate-grid(2, 8); 

        padding: 0; 
        display: table; 
        a { 
         // vertical alignment 
         display: table-cell; 
         height: $headerHeight/2; 
         padding-bottom: 2px; 
         vertical-align: bottom; 

         // appearance 
         color: $greyLight; 
         font-size: 18px; 
         text: { 
          transform: uppercase; 
          decoration: none; 
         } 

         // hover 
         position: relative; 
         &:before { 
          content: ''; 
          display: block; 
          width: $headerUnderlineGap; 
          background: $black; 
          height: $headerHeight; 
          position: absolute; 
          top: 0; 
          margin-left: -$headerUnderlineGap + 1; 
         } 

         &:hover { 
          color: $white; 

          &:after { 
           content: ''; 
           display: block; 
           background: $cyanLight; 
           width: 114%; // TODO check why space(2, 8) does not work 
           height: 4px; 
           position: absolute; 
           margin: -1px 0 0 1px; 
          } 
         } 
        } 
       } 
      } 
     } 
    } 
} 

나는 그것이를 설정하는 비트 해키 느낌 &:after 요소의 너비는 114%이 아니라 space(2, 8). 누구든지 Susy 격자와 연속적인 밑줄이있는 수평 탐색을 설정하는 방법을 설명 할 수 있습니다.이 탐색 방법은 다음 li 요소까지 계속 이동합니다.

미리 감사드립니다.

답변

2

space(2,8)이 경우에는 8이 실제로 컨텍스트가 아니기 때문에 작동하지 않습니다. 2입니다. 단지 space(2,2)이 필요합니다.

+0

안녕하세요 Eric! 고마워요, 잘 작동합니다! 하루 반 동안 나는 그것에 대해 생각하고 있었다. 2가 실제 상황인지 어떻게 설명해 주실 수 있습니까? 모든'li' 엘레멘트에는 2 개의 컬럼이 있기 때문인가요? 다시 감사합니다! 안녕, Niels 추신 : 적어도 15 평판이 필요하기 때문에 투표 할 수없는 유감입니다./ – nielsG

+0

예, 컨텍스트는 항상 동일한 위치의 블록 수준 요소에서 얻을 수있는 동일한 기간입니다. 혹시 요소에 대한 컨텍스트를 찾고 싶다면'display : block; '을 설정하고 그것이 무엇을하는지보십시오. 이 경우,': before' 요소는'2'에 걸쳐있는'li' 내부에 있으므로 - 문맥은'2'입니다. –