2012-08-27 5 views
1

ul 목록이있는 사용자 정의 스크롤 막대를 사용하고 있습니다. 추후 ul 목록이나 li 내용이 확장되면 스크롤 막대가 확장됩니다.공백이 파이어 폭스에 있습니다.

ul 너비가 확장되고 있지만 크롬에서만 작동하지만 firefox/IE 및 다른 브라우저에서는 작동하지 않으므로 주 div에 white-space : nowrap을 사용했습니다.

여기에 내 코드

<div class="horizontalaccordion"> 
      <ul> 
       <li> 
       <h3>Heading 2</h3> 
       <div> 
        Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. 
       </div> 
       </li> 
       <li> 
       <h3>Heading 3</h3> 
       <div>Content For Panel 3.</div> 
       </li> 
       <li> 
       <h3>Heading 4</h3> 
       <div>Content For Panel 4</div> 
       </li> 
       <li> 
       <h3>Heading 1</h3> 
       <div>Content For Panel 1.</div> 
       </li> 
       <h3>Heading 3</h3> 
       <div>Content For Panel 3.</div> 
       </li> 
       <li> 
       <h3>Heading 2</h3> 
       <div>Content For Panel 2.</div> 
       </li> 
       <li> 
       <h3>test</h3> 
       <div>Content For Panel sow</div> 
       </li> 
         <li> 
       <h3>Heading 3</h3> 
       <div>Content For Panel 3.</div> 
       </li> 
       <li> 
       <h3>Heading 4</h3> 
       <div>Content For Panel 4</div> 
       </li> 
      </ul> 
      </div> 

.horizontalaccordion{ 
     height:auto; width:auto; white-space:nowrap; border-radius:4px !important; background-color: #b6b6b6; margin-right:15px ; height:95px; overflow:hidden  
} 
.horizontalaccordion>ul { 
    margin: 0; 
    padding-left:0; 
    list-style:none; 
    height: 95px ; width:auto; display:inline-block 
} 

.horizontalaccordion>ul>li { 
    display:block; 
    overflow: hidden; 
    float:left; 
    margin: 0 !important; 
    padding: 0 !important; 
    list-style:none; 
    width:38px; 
    height: 95px; 

    /* CSS3 Transitions */ 
    transition: width 0.1s ease-in-out; 
    -moz-transition: width 0.1s ease-in-out; 
    -webkit-transition: width 0.1s ease-in-out; 
    -o-transition: width 0.1s ease-in-out; 
} 
.horizontalaccordion>ul>li>h3 { 
    display:block; 
    margin: 5px 0 0 0; 
    padding:10px; 
    height:65px; 
    width:72px; 
    border-radius:6px; 
    box-shadow: 0px -2px 2px #616161; 

    /* Decorative CSS */ 
    font-family: Arial, Helvetica, sans-serif; 
    text-decoration:none; 
    text-transform:uppercase; 
    color: #000; 
    background-color: #B3B3B3; 
    background: -webkit-gradient(linear, 0% 0%, 0% 95%, from(#BEBEBE), to(#B3B3B3)); 
    background: -moz-linear-gradient(top, #BEBEBE 0%, #B3B3B3 95%); 
    font:bold 12px Myriad Pro, Verdana, Geneva, sans-serif; color:#2c3e52; 


    /* CSS3 Transform Rotate & Translate */ 
    white-space:nowrap; 
    -moz-transform: rotate(-90.0deg); /* FF3.5+ */ 
    -o-transform: rotate(-90.0deg); /* Opera 10.5 */ 
    -webkit-transform: rotate(-90.0deg); /* Saf3.1+, Chrome */ 
    transform: rotate(-90.0deg); /* Saf3.1+, Chrome */ 
    filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3.0) 
      progid:DXImageTransform.Microsoft.gradient(startColorstr=#ff999999, endColorstr=#ffcccccc); /* IE6,IE7 */ 
    -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3.0)" 
       "progid:DXImageTransform.Microsoft.gradient(startColorstr=#ff999999, endColorstr=#ffcccccc)"; /* IE8 */ 
} 

.horizontalaccordion>ul>li>div { 
    display:none; 
    float:left; 
    overflow: auto; 
    position:relative; 
    top:-88px; 
    left:40px; 
    *top:0px;  /* IE7 Hack */ 
    *left:0px;  /* IE7 Hack */ 
    margin:0; 
    width:auto; 
    height:68px; 
    padding:10px 50px 10px 10px; white-space:nowrap; 
    background:#f0f0f0; color:#000; 
    border-radius:4px; 
    -webkit-box-shadow: inset 0px 2px 2px #9b9b9b; box-shadow: inset 0px 2px 2px #9b9b9b; 
} 
.horizontalaccordion>ul>li.hover { 
    overflow: hidden; 
    width: auto; 
} 

.horizontalaccordion>ul>li.hover>div { 
    display:block; 
} 

horizontalaccordion>ul>li.hover>h3 { 
    /* Decorative CSS */ 
    color:#fff; 
    background:#000000; 

    /* CSS3 Gradient Effect */ 
    background: -moz-linear-gradient(top, #454545, #000000); /* FF, Flock */ 
    background: -webkit-gradient(linear, left top, left bottom, from(#454545), to(#000000)); /* Safari, Chrome */ 
    filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1.0) 
      progid:DXImageTransform.Microsoft.gradient(startColorstr=#ff454545, endColorstr=#ff000000); /* IE 5.5 - IE 7 */ 
    -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1.0)" 
       "progid:DXImageTransform.Microsoft.gradient(startColorstr=#ff454545, endColorstr=#ff000000)"; /* IE 8 */ 
} 
.horizontalaccordion>ul>li>h3:hover { 
    cursor:pointer; 
    /* Decorative CSS */ 

} 

​ 

답변

2

I set up your code on a JS Fiddle 시도하고 더 나은 문제를 조금 이해하는 CSS입니다.

몇 가지 :

  • 귀하의 HTML 코드는 물건을 파괴 할 수 오프닝 <li> 태그를가 없습니다.
  • 나를 위해 Firefox (14)와 Chrome (18)에서 동작이 동일하게 보입니다. 공백을 감싸는 것들에 대해서는 IE9조차도 작동하는 것처럼 보인다.
  • Javascript가 없으면이 기능을 작동시키는 데 정확히 어떻게 동의하는지 잘 모르겠습니다.

white-space:nowrap 스타일의 규칙은, (here 참조) 포장에서 텍스트를 미연에 방지하기위한 (그리고 내가에 링크 된 바이올린에 성공적으로이 작업을 수행), 그러나 포장에서 요소를 방지하기 위해 아무것도하지 않는다.

overflow-x: visible; /* shows all items even if the area is too small */ 
overflow-x: scroll; /* Will always show a scrollbar */ 
overflow-x: auto; /* Will only show a scrollbar when the content doesn't fit */ 
overflow-x: hidden; /* Content will just drop off the end of the page */ 

나는이 당신을 도움이되기를 바랍니다 :

아마도 당신이 원하는 것은

whitespace: nowrap 

을 제거하고 다음 중 하나를 사용하는 것입니다. 그것이 당신이 원하는 바를 정확히 밝힐 수 있다면 좋을 것입니다. JSFiddle에서 당신이 찾고있는 것을 정확히 볼 수 있다면, 상황을 바꿀 수 있고, 업데이트하고, 링크를 게시 할 수 있습니다.

관련 문제