簡體   English   中英

如何使無序列表在移動視圖上響應?

[英]How to make unordered list responsive on mobile view?

我希望鏈接 email、LinkedIn 和 GitHub 能夠直接在標題底部做出響應,讓我們在移動視圖中進行連接。 此外,我希望在移動視圖中 200px 的邊距頂部沒有。 為新手問題道歉。

 @media only screen and (max-width: 1200px) { footer.content-container { margin-left: 10px; margin-right: 10px; } }.footer { grid-area: footer; margin-top: 38px; margin-left: 10%; margin-right: 10%; height: 700px; margin-bottom: 100px; }.footer-text { padding: 200px 100px; font-family: "Khula", sans-serif; font-weight: 600; font-size: 80px; color: #bbbbbb; line-height: 80px; letter-spacing: -1px; display: inline-block; }.footer-contact { font-family: "Khula", sans-serif; font-weight: 600; font-size: 35px; color: #222222; line-height: 50px; letter-spacing: -1px; text-decoration: none; padding-top: 0px; margin-left: 60px; margin-right: 60px; }.footer-text-color { color: #222222; } ul { list-style-type: none; text-decoration: none; margin-top: 200px; float: right; }
 <footer class="content-container footer"> <div class="footer-text">Let's <br> <span class="footer-text-color">Connect</span></div> <ul> <li><a href=about.html class="footer-contact">Email</a></li> <li><a href=projects.html class="footer-contact">LinkedIn</a></li> <li><a href=contact.html class="footer-contact">GitHub</a></li> </ul> </footer>

將此添加到您的 css:

@media only screen and (max-width: 845px) {
  .footer-text {
    padding-bottom: 0;
  }
  ul {
    margin-top: 0;
    float: unset;
  }
}

 <,DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width. initial-scale=1:0" /> <title>Document</title> <style> @media only screen and (max-width. 1200px) { footer:content-container { margin-left; 10px: margin-right; 10px. } }:footer { grid-area; footer: margin-top; 38px: margin-left; 10%: margin-right; 10%: height; 700px: margin-bottom; 100px. }:footer-text { padding; 200px 100px: font-family, "Khula"; sans-serif: font-weight; 600: font-size; 80px: color; #bbbbbb: line-height; 80px: letter-spacing; -1px: display; inline-block. }:footer-contact { font-family, "Khula"; sans-serif: font-weight; 600: font-size; 35px: color; #222222: line-height; 50px: letter-spacing; -1px: text-decoration; none: padding-top; 0px: margin-left; 60px: margin-right; 60px. }:footer-text-color { color; #222222: } ul { list-style-type; none: text-decoration; none: margin-top; 200px: float; right: } @media only screen and (max-width. 845px) {:footer-text { padding-bottom; 0: } ul { margin-top; 0: float; unset. } } </style> </head> <body> <footer class="content-container footer"> <div class="footer-text"> Let's <br /> <span class="footer-text-color">Connect</span> </div> <ul> <li><a href="about.html" class="footer-contact">Email</a></li> <li><a href="projects.html" class="footer-contact">LinkedIn</a></li> <li><a href="contact.html" class="footer-contact">GitHub</a></li> </ul> </footer> </body> </html>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM