반응형 웹사이트 드롭다운 양식 문제 (Responsive Website Dropdown form issue)


문제 설명

반응형 웹사이트 드롭다운 양식 문제 (Responsive Website Dropdown form issue)

Foundation 5 프레임워크의 드롭다운 양식에 약간의 문제가 있습니다.

기본적으로 입력 필드와 버튼을 드롭다운 메뉴에 할당하고 있는데 잘 작동합니다.

하지만 첫 번째 드롭다운에서와 같이 뒤로 버튼을 먼저 볼 수 없기 때문에 그 이유를 알 수 없습니다. 기본 코드가 복제일 때.

두 번째 드롭다운을 보고 메뉴로 돌아가서 드롭다운을 보려면 입력 필드와 버튼이 표시됩니다...

아래 소스 코드:

CSS:

      .has‑form‑small {

        top: 0rem;
        left: 0rem;
        min‑width: 15rem; }
      @media only screen and (max‑width: 40em) {
        .has‑form {
          min‑width: 10rem;
          top: 0 rem; }
        .has‑form .button {
          height: 3rem; } }
    </style>

HTML: 드롭다운 1:

<section class='top‑bar‑section'>
  <!‑‑ Right Nav Section ‑‑>
  <ul class='right'>
    <li><a href='#'>Button</a></li>
    <li class='has‑dropdown'>
      <a href='#'>Dropdown</a>
      <ul class='dropdown'>
        <li><a href='#'>link</a></li>
        <li><a href='#'>link</a></li>
      </ul>
    </li>
  </ul>
</section>

드롭다운 2:

    <section class='top‑bar‑section'>
      <!‑‑ Right Nav Section‑‑>
      <strong class='show‑for‑small‑only'>
      <ul class='right'>
        <li class='has‑dropdown'>
          <a href='#'>Dropdown2</a>
          <ul class='dropdown'>
              <li class='has‑form‑small'>
                <div class='row collapse'>
                  <div class='large‑9 small‑9 columns'>
                    <input type='text' placeholder='Find Stuff'>
                </div>
                <div class='large‑3 small‑3 columns'>
                    <a href='#' class='alert button expand'>Search</a>
                </div>
                </div>
              </li>
          </ul>
        </li>
      </ul>
      </strong>
    </section>

참조 솔루션

방법 1:

Managed to fix in the end. Turns out a drop down menu option isn't needed.

Code as below:

CSS:

    <style>
  .has‑form‑small {
    color: darkslategray;
    position: absolute;
    top: 0rem;
    left: 0rem;
    min‑width: 26rem;
    min‑height: 2.7rem;}
  @media only screen {
    .has‑form‑small {
      color: darkslategray;
      min‑width: 26rem;
      min‑height: 2.7rem;
      top: 0rem; }
    .has‑form‑small .button {
      color: darkslategray;
      width:  10rem;}}
</style>

HTML:

<nav class='top‑bar' data‑topbar role='navigation'>
    <ul class='title‑area'>
      <li class='name'>
        <h1><a href='#'>My Site</a></h1>
      </li>
      <strong class='hide‑for‑small‑only'>
      <li class='has‑form'>
        <div class='row collapse'>
          <div class='large‑9 small‑9 columns'>
            <input type='text' placeholder='Find Stuff'>
          </div>
          <div class='large‑3 small‑3 columns'>
            <a href='#' class='alert button expand'>Search</a>
          </div>
        </div>
      </li>
      </strong>
      <!‑‑ Remove the class 'menu‑icon' to get rid of menu icon. Take out 'Menu' to just have icon alone ‑‑>
      <li class='toggle‑topbar menu‑icon'><a href='#'><span>Menu</span></a></li>
    </ul>

    <section class='top‑bar‑section'>
      <!‑‑ Right Nav Section ‑‑>
      <ul class='right'>
        <li><a>&nbsp</a></li>
        <li>
        <strong class='show‑for‑small‑only'>
          <li class='has‑form‑small'>
              <div class='large‑12 small‑9 columns'>
                <input type='text' placeholder='Find Stuff'>
              </div>
              <div class='large‑3 small‑3 columns'>
                <a href='#' class='alert button expand'>Search</a>
              </div>
          </li>
        </strong>
        </li>
      </ul>



      <ul class='right'>
        <li><a href='#'>Button</a></li>
        <li class='has‑dropdown'>
          <a href='#'>Dropdown</a>
          <ul class='dropdown'>
            <li><a href='#'>link</a></li>
            <li><a href='#'>link</a></li>
          </ul>
        </li>
      </ul>

      <!‑‑ Left Nav Section ‑‑>
      <ul class='left'>

      </ul>
    </section>
  </nav>

There may be better ways to do this (e.g. remove blank row with "&nspb") but I was having issues with background colours, and this is supposed to only be a demo site.

(by Nathan EnglishNathan English)

참조 문서

  1. Responsive Website Dropdown form issue (CC BY‑SA 2.5/3.0/4.0)

#zurb-foundation #zurb-foundation-5






관련 질문

zurb-foundation Rails gem에 캔버스 외 레이아웃 포함 (Including off-canvas layouts with the zurb-foundation Rails gem)

CSS zurb 기초 및 dhtmlx (CSS zurb foundation and dhtmlx)

기초 바닥글이 전체 페이지 너비가 아닙니다. (Foundation footer is not full page width)

slick.js 플러스 파운데이션 이퀄라이저 문제 (slick.js plus foundation equalizer issue)

반응형 웹사이트 드롭다운 양식 문제 (Responsive Website Dropdown form issue)

Foundation 6의 TopBar가 작동하지 않음 (TopBar in foundation 6 not working)

_settings.scss의 변수는 주석 처리되지 않은 상태로 컴파일됩니다. (Variables in _settings.scss are compiled as uncommented)

Foundation for Apps 프로젝트의 양쪽 맞춤 탭 (Justified tabs in Foundation for Apps project)

휴대폰에서 보이지 않는 웹사이트의 일부 (Part of the Website invisible on mobile phone)

Zurb Foundation 구성 요소가 작동하지 않음 (Zurb Foundation components not working)

Foundation 탭이 초기화되었는지 확인하는 방법은 무엇입니까? (How to check if Foundation tabs are initialized?)

Zurb Foundation 균등화 그리드: 그리드 셀 내부의 div 하단에 콘텐츠를 배치하는 방법 (Zurb Foundation equalised grid: how to position content at bottom of div inside grid cell)







코멘트