在Foundation导航栏中垂直对齐文本

问题描述 投票:0回答:1

我试图让左上角包含280 x 70图像的顶栏导航菜单对齐右边的菜单选项。我可以在Foundation中左右对齐文本,但我找不到垂直对齐的方法。

Example Fiddle

<div class="row full-width">
<div class="large-4 columns">
    <img src="MyLogo.png" width="280" height="70" alt="My 280 x 70 Logo" />
</div>
<div class="large-8 columns">
    <nav class="top-bar" data-topbar role="navigation">
        <ul class="title-area">
            <li class="name">
                <div class="logo"> <a href="#"></a>
                </div>
            </li>
            <li class="toggle-topbar menu-icon"> <a href="#"><span></span></a>
            </li>
        </ul>
        <section class="top-bar-section">
            <!-- Right Nav Section -->
            <ul class="right">
                <li class="active"> <a href="/home/index" class="menuMix">
                            <span class="menuMinor">Home Page</span>
                            <span class="menuMain allCaps">Home</span>
                        </a>
                </li>
                <li class=""> <a href="/home/about" class="menuMix">
                            <span class="menuMinor">Who We Are</span>
                            <span class="menuMain allCaps">About</span>
                        </a>
                </li>
                <li class=""> <a href="/home/contact" class="menuMix">
                            <span class="menuMinor">Get In Touch</span>
                            <span class="menuMain allCaps">Contact</span>
                        </a>
                </li>
            </ul>
        </section>
    </nav>
</div>

css zurb-foundation
1个回答
0
投票

最简单的方法是使用flexbox。

.top-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

Example

© www.soinside.com 2019 - 2024. All rights reserved.