0

したがって、基本的には、Wordpress で次のようなメニューを作成する必要があります。

必要なメニュー:

赤いバーはページの幅で、固定されていないため、サイズ変更で縮小できます。そしてサブメニューは中央に

私は現在持っています:

現時点の

CSS は次のとおりです。

#access {
    clear: both;
    display: block;
    margin: 0 auto -10px;
    width: 100%;
    text-align:center;
}
#access ul {
    font-size: 13px;
    list-style: none;
    margin: 0 0 0 -0.8125em;
    margin-top: 0.3em;
    padding-left: 0;
    display:inline-block;
    /*Font*/
    letter-spacing:1px;
    text-transform:uppercase;
    color: #FFF;
}
#access li {
    float: left;
    position: relative;
}
#access a {
    color: #eee;
    display: block;
    line-height: 2.333em;
    margin: 0 1.2125em;
    margin-bottom: 0.5em;
    padding-top: 0.5em;
    text-decoration: none;
    /* Same colour as background */
    border-bottom: 1px solid #000;
}
#access ul ul {
    display: none;
    position: inherit;
    top: 0; left: 0;
    margin: 0 auto;
    width: 100%;
    z-index: 9999;
    float: left;
}

#access ul ul a {
    color: #444;
    font-size: 13px;
    font-weight: normal;
    height: auto;
    line-height: 1.4em;
    padding: 10px 10px;
    display: inline-block;
}
#access ul ul li {
    display: inline-block;
}

どんな助けでも

4

1 に答える 1

0

あなたのために作成されたこのjsfiddleを確認してください

メニューコードの後に​​新しい部門を定義し、sub-menu-bgそれに赤い背景を与えました。また、正しい水平ドロップダウン メニューを実現するために CSS を編集しました。

これで問題が解決することを願っています。

于 2012-05-13T06:20:55.177 に答える