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

约索菲亚·沙欣

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

在我网站的附加链接中。我需要页脚位于“联系人”和“关于”页面中移动/iPhone 屏幕的底部。它在我的 PC 屏幕上看起来不错,但在我的 iPhone 上却没有。

我尝试了@media (max-width),然后增加了 main-footer 的上边距以将其向下推,但是没有用。我将包括联系页面的代码。

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:[email protected]" 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:

 .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;
 }
银甜

请将以下内容添加到您的 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%;
    }
}

然后,将类“sticky-bottom”添加到 about.html 和 contact.html:

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

这应该被评论或删除:

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

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

} */

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何使底部工作表在不同的屏幕尺寸上调整其尺寸?

如何根据屏幕尺寸调整页面上Divs的大小?

如何在所有屏幕尺寸上调整视图大小?

SwiftUI如何调整不同的屏幕尺寸

调整页脚内容

重新调整屏幕尺寸时出现页脚

页脚应调整为屏幕尺寸

如何在QMainWindow上调整窗户的装饰尺寸?

如何在缩小屏幕尺寸时使页脚不可见?

如何使我的网站自动调整以适合不同的屏幕尺寸?

我们如何调整不同屏幕尺寸的布局?

Bootstrap 4-如何正确调整页脚中的内容?

调整页面大小(页脚)时如何防止DIVS冲突?

如何在不同的屏幕尺寸下获得不同的显示

调整按钮以适应不同的屏幕尺寸

调整UITableViewCell的大小以适合不同的屏幕尺寸

当您使用不同的高度页面时,如何使页脚位于所有屏幕尺寸的底部?

如何在本机反应中处理不同的屏幕尺寸?

如何在Android中创建不同的屏幕尺寸图像

如何在不同屏幕尺寸上测试Flutter小部件?

为移动设备调整页脚大小

如何根据屏幕尺寸调整图像

如何针对不同的屏幕尺寸动态调整文字大小和边距?

如何在不同屏幕尺寸的设备中显示相同尺寸的对话框

如何在 SwiftUI 中以相同的度量显示不同屏幕尺寸的屏幕?

如何在ReactOS中调整页面文件的大小?

将 SKSurface 转换为 SKBitmap 并在不同的设备尺寸上调整为特定尺寸的图像

如何在Vuetify中使用断点为不同的屏幕尺寸指定不同的边距

如何使动画适应不同的屏幕尺寸?迅速