gpt4 book ai didi

html - 如何减小 html 下拉菜单中字体/菜单栏的大小

转载 作者:行者123 更新时间:2023-11-28 05:49:29 25 4
gpt4 key购买 nike

您好,这可能是一个简单的问题。我正在尝试制作一个下拉导航菜单,但不幸的是,这个菜单的空间有限,我无法弄清楚如何减小字体大小和菜单大小,以便我可以添加更多选项并使其适合部分。到目前为止,我发现的所有关于减小字体大小和

  • 大小的搜索都不起作用。谁能告诉我怎么做?

    下面是我的代码

    如果这是一个简单的答案,再次抱歉

    .third-level-menu {
    position: absolute;
    top: 0;
    right: -150px;
    width: 150px;
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    }
    .third-level-menu > li {
    height: 30px;
    background: #999999;
    width: 190px;
    }
    .third-level-menu > li:hover {
    background: #CCCCCC;
    }
    .second-level-menu {
    position: absolute;
    top: 30px;
    left: 0;
    width: 150px;
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    }
    .second-level-menu > li {
    position: relative;
    height: 30px;
    background: #999999;
    }
    .second-level-menu > li:hover {
    background: #CCCCCC;
    }
    .top-level-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    }
    .top-level-menu > li {
    position: relative;
    float: left;
    height: 30px;
    /*width: 220px;*/
    background: #999999;
    }
    .top-level-menu > li:hover {
    background: #CCCCCC;
    }
    .top-level-menu li:hover > ul {
    /* On hover, display the next level's menu */
    display: inline;
    }
    /* Menu Link Styles */

    .top-level-menu a
    /* Apply to all links inside the multi-level menu */

    {
    font: bold 14px Arial, Helvetica, sans-serif;
    color: #FFFFFF;
    text-decoration: none;
    padding: 0 0 0 10px;
    /* Make the link cover the entire list item-container */
    display: block;
    line-height: 30px;
    }
    .top-level-menu a:hover {
    color: #000000;
    }
    <ul class="top-level-menu">
    <li><a href="#">Reporting </a>
    <ul class="second-level-menu">
    <li><a href="#">test1</a>
    </li>
    <li><a href="#">test2</a>
    </li>
    <li><a href="#">test3</a>
    </li>
    <li><a href="#">test4</a>
    </li>
    </ul>


    </li>
    <li><a href="#">Process Optimization</a>
    </li>
    <li>
    <a href="#">Operations </a>
    <ul class="second-level-menu">
    <li><a href="#">Access </a>
    </li>
    <li><a href="#">exit</a>
    </li>
    <li>
    <a href="#">Support</a>
    <ul class="third-level-menu">
    <li><a href="#">Anniversary Letters</a>
    </li>
    <li><a href="#">authorizations</a>
    </li>
    <li><a href="#">Documentation</a>
    </li>
    <li><a href="#">Tasks</a>
    </li>
    </ul>
    </li>
    <li><a href="#">Compliance</a>
    </li>
    </ul>
    </li>
    <li><a href="#">Connect Site</a>
    </li>
    </ul>

  • 最佳答案

    这是你的罪魁祸首:

    .top-level-menu a /* Apply to all links inside the multi-level menu */
    {
    font: bold 14px Arial, Helvetica, sans-serif;
    color: #FFFFFF;
    text-decoration: none;
    padding: 0 0 0 10px;

    /* Make the link cover the entire list item-container */
    display: block;
    line-height: 30px;
    }

    不要使用速记版本(然而,通常更可取),使用:

    .top-level-menu a /* Apply to all links inside the multi-level menu */
    {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    font-size: 10px;
    ..etc
    }

    关于html - 如何减小 html 下拉菜单中字体/菜单栏的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37422683/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com