Foundation 5: Create a TopBar Navigation With a Mobile Menu

9/1/2014 3:20:45 PM

Use Foundation 5 to create a simple Top Bar Navigation that adjusts to mobile devices. For mobile you will see three lines giving access to the menu items.

*This requires the Foundation 5 complete files to be downloaded.

<!doctype html>
    <meta name="Title" content="" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="foundation/foundation-5.4.0/css/foundation.css" rel="stylesheet" />
    <link href="foundation/foundation-5.4.0/css/normalize.css" rel="stylesheet" />
    <!-- your css -->
    <script src="foundation/foundation-5.4.0/js/vendor/modernizr.js"></script>


<body id="body">

    <nav class="top-bar" data-topbar="" role="navigation">
        <ul class="title-area">
            <li class="name">
                <h1><a href="/" title="home"></a></h1>
            <li class="toggle-topbar menu-icon"><a><span></span></a></li>

        <section class="top-bar-section">

            <!-- Right Nav Section -->
            <ul class="right show-for-large-up">
                <li><a href="/login/">Login / Register</a></li>

            <ul class="right hide-for-large-up">
                <li><a href="/forums/">Forums</a></li>
                <li><a href="/blogs/">Blogs</a></li>
                <li><a href="/login/">Login / Register</a></li>

            <!-- Left Nav Section -->
            <ul class="left show-for-large-up">
                <li><a href="/forums/">Forums</a></li>
                <li><a href="/blogs/">Blogs</a></li>

    <!-- js jQuery mist be before foundation-->
    <script src=""></script>

    <!-- js Foundation must be at the bottom of the body tag-->
    <script src="foundation/foundation-5.4.0/js/vendor/fastclick.js"></script>
    <script src="foundation/foundation-5.4.0/js/foundation.min.js"></script>