1

我试图有一个水平菜单,所有项目都有下拉菜单,但一直保持垂直,我似乎无法弄清楚为什么。a 标签总是占据我页面的全宽,即 900 像素。但是没有任何风格可以定义这一点。所以我迷路了,任何帮助将不胜感激。

 <div class="navbar">
    <div class="navbar-inner">
        <ul class="nav">
            <li>
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Starting a Business</a>
                <ul class="dropdown-menu">
                    <li><a href="#">Web Design</a></li>
                    <li><a href="#">Web development</a></li>
                    <li><a href="#">Wordpress Theme development</a></li>
                </ul>
            </li>
            <li>
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Starting a Business</a>
                <ul class="dropdown-menu">
                    <li><a href="#">Web Design</a></li>
                    <li><a href="#">Web development</a></li>
                    <li><a href="#">Wordpress Theme development</a></li>
                </ul>
            </li>
            <li>
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Starting a Business</a>
                <ul class="dropdown-menu">
                    <li><a href="#">Web Design</a></li>
                    <li><a href="#">Web development</a></li>
                    <li><a href="#">Wordpress Theme development</a></li>
                </ul>
            </li>
            <li>
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Starting a Business</a>
                <ul class="dropdown-menu">
                    <li><a href="#">Web Design</a></li>
                    <li><a href="#">Web development</a></li>
                    <li><a href="#">Wordpress Theme development</a></li>
                </ul>
            </li>
        </ul>
    </div>
4

1 回答 1

1

您是否使用引导程序 3,是这样吗,此代码将起作用,请参阅工作小提琴

<div class="navbar navbar-default">
    <div class="navbar-header"></div>
    <ul class="nav navbar-nav">
        <li> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Starting a Business</a>

            <ul
            class="dropdown-menu">
                <li><a href="#">Web Design</a>
                </li>
                <li><a href="#">Web development</a>
                </li>
                <li><a href="#">Wordpress Theme development</a>
                </li>
    </ul>
    </li>
    <li> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Starting a Business</a>

        <ul
        class="dropdown-menu">
            <li><a href="#">Web Design</a>
            </li>
            <li><a href="#">Web development</a>
            </li>
            <li><a href="#">Wordpress Theme development</a>
            </li>
            </ul>
    </li>
    <li> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Starting a Business</a>

        <ul
        class="dropdown-menu">
            <li><a href="#">Web Design</a>
            </li>
            <li><a href="#">Web development</a>
            </li>
            <li><a href="#">Wordpress Theme development</a>
            </li>
            </ul>
    </li>
    <li> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Starting a Business</a>

        <ul
        class="dropdown-menu">
            <li><a href="#">Web Design</a>
            </li>
            <li><a href="#">Web development</a>
            </li>
            <li><a href="#">Wordpress Theme development</a>
            </li>
            </ul>
    </li>
    </ul>
</div>
于 2013-09-15T07:10:29.170 回答