简体   繁体   English

如何在不同的屏幕尺寸上调整页脚

[英]how to adjust the footer on different screen sizes

https://yosofya.github.io/portfolio-V2.2/index.html https://yosofya.github.io/portfolio-V2.2/index.html

in the attached link of my website.在我网站的附加链接中。 I need the footer to be on the bottom of the Mobile/iPhone screens in Contact and About pages.我需要页脚位于联系人和关于页面中移动/iPhone 屏幕的底部。 It looks fine on my PC screen but on not on my iPhone.它在我的 PC 屏幕上看起来不错,但在我的 iPhone 上却不行。

I tried @media (max-width) and then increased the top margin of main-footer to push it down, but it didn't work.我尝试了@media (max-width),然后增加了主页脚的上边距以将其向下推,但它没有用。 I will include the codes for the Contact page.我将包含联系人页面的代码。

HTML: HTML:

<div class="contact-title">

  <h1> class="animated fadeInUp">Contact Me</h1>
  <p> Make sure you provide me with all of the information in case you
    want my help with your project. </p> <br>
    <p>I will be glad to reply as soon as possible. </p>
  </div>

  <form class="contact-form" action="mailto:designist.joey@gmail.com" method="post" enctype="text/plain">

    <input class="form-inputs" type="text" name="Name" size="50" placeholder="Your Name"> <br>
    <input class="form-inputs" type="email" name="Email" size="50" placeholder="Your Email"> <br>
    <textarea class="form-textarea" name="Meesage" rows="8" cols="52" placeholder="Your Message"></textarea> <br>
    <button class="form-button" type="submit" value="Send">Submit</button>


  </form>


</div>

CSS: CSS:

 .contact-title h1 {

 font-size: 7rem;
 margin-bottom: 20px;

}

 .contact-title p {
  margin: 2px 0;


}

.contact-form {

margin-top: 100px;
}

@media (max-width:600px) {

.main-footer { margin-top:600px;}

 }

 .main-footer p {

 padding-bottom: 100px;
 letter-spacing: 7px;
 margin: 0;
 }

Try this.尝试这个。

@media (max-width: 600px) {
  .main-footer {
     margin-top: 0px;
 }
}

Please add the following to your style.css:请在您的 style.css 中添加以下内容:

@media (orientation:portrait) and (min-height: 1080px){
    body, html{
      margin:0;
      height:100%;
    }
}

@media (orientation:portrait) and (min-height: 1080px){
    .container-fluid {
      height: 100%;
    }
}

@media (orientation:portrait) and (min-height: 1080px){
    .main-footer.sticky-bottom {
      position: absolute; 
      left: 0; 
      right: 0; 
      bottom: 0;
    }
}

@media (orientation:portrait) and (min-height: 1080px){
    .contact-background {
      height: 100%;
    }
}

Then, add the class 'sticky-bottom' to about.html and contact.html:然后,将 class 'sticky-bottom' 添加到 about.html 和 contact.html 中:

<div class="main-footer sticky-bottom">

This should be commented or removed:这应该被评论或删除:

/* @media (max-width:600px) {

.main-footer { margin-top:600px;}

} */

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM