亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

調整窗口大小時搜索表單被拆分

調整窗口大小時搜索表單被拆分

慕容3067478 2022-12-09 15:02:19
所以我創建了一個標頭,在一些幫助下,我能夠比以前更好地獲得響應。但是我注意到兩個問題:搜索表單被分成兩部分菜單項文本之一顯示在 2 行或更多行上。我一直在尋找確保它始終保持在一條線上。和CSS.header-village {    background-color: white;    width: 100%;    max-width: 1200px;    height: 80px;    margin: 2% auto;  }    .header-search-container {    width: 470px;    min-width: 470px;    height: 40px;    border-radius: 20px;    margin-left: 60px;  }    .header-search-prepend {    width: 40px;    height: 40px;    border-top-left-radius: 20px;    border-bottom-left-radius: 20px;    border-right: 0px none;    background-color: #f4f7f8;  }    .header-search-img {    text-align: center;    display: block;    justify-content: center;    align-items: center;    margin: auto;    width: 18px;    height: 18px;    margin-top: 30%;  }    .header-search-form {    width: 430px;    height: 40px;    border-top-right-radius: 20px;    border-bottom-right-radius: 20px;    border-left: 0px none;    background-color: #f4f7f8;    font-family: Source Sans Pro;    text-align: left;    color: #cecece;  }    .header-avatar-pic {    width: 45px;    height: 45px;    border-radius: 100px;  }    .header-menu-item {    font-family: Fredoka One;    font-size: 18px;    margin-right: 25px;    color: #dfdfdf;  }    .header-menu-item:hover {    color: #ff7255;    border-bottom-style: none;    border-bottom: 0px;  }    .header-divider {    background-color: #ff7255;  }    .drop-down-menu {    border-radius: 50px;    box-shadow: "0px 8px 18px 0 rgba(0,0,0,0.14)";  }  .dropdown-toggle > div {    display: inline-block;  }  .navbar-nav {    align-items: center;    margin-left: auto;  }    .header-drop-down-name {    font-size: 20px;    font-family: Source Sans Pro;    color: #333333;    font-weight: bold;  }    .nav-item {    font-size: 20px;    font-family: Source Sans Pro;    color: #616161;    font-weight: normal;  }    .nav-item:hover {    color: #ff7255;  }  所以我不明白為什么我的搜索不能把它放在一起而不是分開,以及我如何確保文本總是適合一行
查看完整描述

1 回答

?
紅顏莎娜

TA貢獻1842條經驗 獲得超13個贊

在你的另一個問題中我已經解決了這個問題,所以如果你的桌面菜單要增加并且你仍然希望它在一起,只需更改它,添加flex-wrap: nowrap;桌面 CSS 并調整寬度,我在下面給了你 2 個類,使用它們在 dektop css 上,而不是在 Media Query 中,只需替換這兩個類的代碼,它就不會中斷,


.header-search-container {

    width: 100%;

    max-width: 470px;

    min-width: auto;

    height: 40px;

    border-radius: 20px;

    margin-left: 60px;

    flex-wrap: nowrap;

 }


.header-search-form {

    max-width: 430px;

    height: 40px;

    border-top-right-radius: 20px;

    border-bottom-right-radius: 20px;

    border-left: 0px none;

    background-color: #f4f7f8;

    font-family: Source Sans Pro;

    text-align: left;

    color: #cecece;

    width: 100%;

}

是的,不要忘記也贊成最后的答案。如果需要其他任何東西或這不起作用,請隨時詢問 Happy Coding。


查看完整回答
反對 回復 2022-12-09
  • 1 回答
  • 0 關注
  • 174 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號