gpt4 book ai didi

php - 将 Nav a 元素排列在彼此下方

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

我有一个这样的菜单栏

<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>

CSS如下

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;
}

当用户调整大小时,我希望导航 A 跟随在下方(垂直对齐)我该怎么做?

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

我应该怎么做才能使导航项在调整大小时垂直跟随彼此?

最佳答案

像那里一样使用显示 block : http://jsfiddle.net/c0y518bn/

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

固定边框底部版本:http://jsfiddle.net/c0y518bn/1/

关于php - 将 Nav a 元素排列在彼此下方,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26082645/

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