我试图让我的导航响应,我不知道如何,它想要它,所以它不会跳到下一行,我知道填充导致这一点,我可以帮助这个使用百分比作为宽度,但看起来很丑陋。响应式导航
这是页面的外观正常解析: http://imgur.com/a/YO7xh
这是它的外观,当我放大。(这是什么,我不希望发生的事情): http://imgur.com/a/a3Siu
我能做些什么来防止这种情况发生?
代码导航:
.header-side .game {
float: right;
}
.header-side .selected {
color: #f7c22c;
}
.header-side .other {
float: left;
}
.bottom-header {
height: 115px;
border-bottom: 1px solid #343538;
display: flex;
color: #787878;
text-transform: uppercase;
font-size: 14px;
}
header {
width: 100%;
}
.top-header {
height: 45px;
border-bottom: 1px solid #343538;
width: 100%;
}
.header-side {
width: 45%;
height: 100%;
}
.header-middle {
width: 10%;
margin: auto;
display: flex;
align-items: center;
}
.header-divider {
height: 60px;
text-align: center;
transform: rotate(45deg);
width: 60px;
margin: auto;
border: 1px solid #f7c22c;
}
<header>
<div class="top-header">
This is the top header!
</div>
<div class="bottom-header">
<div class="header-side">
<div class="nav-item game">skin upgrade</div>
<div class="nav-item game">skin royale</div>
<div class="nav-item game selected">skin crash</div>
</div>
<div class="header-middle">
<div class="header-divider">
</div>
</div>
<div class="header-side">
<div class="nav-item other">deposit</div>
<div class="nav-item other">withdraw</div>
<div class="nav-item other">provably fair</div>
</div>
</div>
</header>
好吧,所以我现在试着这样做,但填充似乎并没有消失? –
@media屏幕和(最大宽度:768px){ \t \t .nav项{ \t \t \t填充:0; \t \t} \t} –
记得在css的末尾使用媒体查询,并尝试使用!important来强制css属性 –