doujiao9866 2014-09-28 07:25
浏览 40
已采纳

安排导航彼此之下的项目

I have a menu bar like this

<header>
        <nav>
            <a href="#">Home</a>
            <a href="#">Our Story</a>
            <a href="#">Tools</a>
            <a href="#">Technology</a>
            <a href="#">Pricing</a>
            <a href="#">Contact</a>
            <a href="#">Careers</a>
        </nav>
    </header>

The CSS is follows

header {
    position: fixed;
    width: 100%;
    height: 65px;
    opacity: 0.8;
    background-color: #fcfcfc;
    border-bottom: 5px solid #53bf6b;
    z-index: 10;
}

header nav {
    padding-top: 10px;
    text-align: center;
}

header nav a {
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 26px;
    padding-right: 20px;
    color: #f35626;
    background-image: -webkit-linear-gradient(92deg, #f35626, #feab3a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-animation: hue 60s infinite linear;
}

And when the user resizes I want to Nav A to be followed below (align vertically) How can I do this ?

@media only screen and (min-width: 150px) and (max-width: 550px) {
 /* I must set the code to arrange the nav a items here */
}

What should I do to make the nav a items follow each other vertically when resized ?

  • 写回答

2条回答 默认 最新

  • drbae3964 2014-09-28 07:27
    关注

    Use display block like there: http://jsfiddle.net/c0y518bn/

    @media only screen and (min-width: 150px) and (max-width: 550px) {
        nav a {display: block;}
    }
    

    Fixed border-bottom version: http://jsfiddle.net/c0y518bn/1/

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 请问为什么我配置IPsec后PC1 ping不通 PC2,抓包出来数据包也并没有被加密
  • ¥200 求博主教我搞定neo4j简易问答系统,有偿
  • ¥15 nginx的使用与作用
  • ¥100 关于#VijeoCitect#的问题,如何解决?(标签-ar|关键词-数据类型)
  • ¥15 一个矿井排水监控系统的plc梯形图,求各程序段都是什么意思
  • ¥15 ensp路由器启动不了一直报#
  • ¥50 安卓10如何在没有root权限的情况下设置开机自动启动指定app?
  • ¥15 ats2837 spi2从机的代码
  • ¥200 wsl2 vllm qwen1.5部署问题
  • ¥100 有偿求数字经济对经贸的影响机制的一个数学模型,弄不出来已经快要碎掉了