gpt4 book ai didi

html - 您将如何修复显示为列表的导航栏?

转载 作者:太空宇宙 更新时间:2023-11-04 14:09:30 25 4
gpt4 key购买 nike

当我尝试制作导航栏时,我希望它向右浮动,但是当我这样做时,

  • 元素在我希望它们水平显示时垂直显示。

    #navigation ul{
    font-family: 'Roboto', sans-serif;
    float: right;
    overflow: hidden;
    line-height: 1px !important;
    /*position: fixed;*/
    }
    #navigation ul li h3 {
    font-weight: normal;
    font-size: 34px !important;
    color: #000;
    margin-right: auto;
    padding: 0;
    margin: auto;
    letter-spacing: 0.25px;
    }
    #navigation ul li {
    list-style: none;
    line-height: 40px !important;
    }
    #navigation a{
    text-align: center;
    }
    <header>
    <nav id="navigation">
    <ul>
    <li>
    <a href="./entry.html"><h3>Home</h3></a>
    <a href="#"><h3>About</h3></a>
    <a href="#"><h3>Timeline</h3></a>
    <a href="#"><h3>Video</h3></a>
    </li>
    </ul>
    </nav>
    </header>

  • 最佳答案

    尝试插入一个显示:inline;在元素上。

    #navigation ul li h3 {
    font-weight: normal;
    font-size: 34px !important;
    color: #000;
    margin-right: auto;
    float:right;
    padding: 0;
    margin: auto;
    letter-spacing: 0.25px;
    display:inline;

    关于html - 您将如何修复显示为列表的导航栏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54714189/

    25 4 0