Firefox不兼容

时间:2018-09-01 19:37:55

标签: html css html5 css3

我即将结束我的第一个Web项目,当我检查浏览器时,我发现Firefox在页脚中导致以下错误。

查看Chrome:

enter image description here

查看Firefox:

enter image description here

正如您在其他浏览器中看到的那样,它可以正常运行,并且在firefox中看起来非常完美,它是唯一为我创造空间的人,如果可以的话,我将不胜感激。这是代码:

footer 
{
    position: absolute;
    top: 2050px;
    height: 330px;
}

footer div#aboutme
{
    width: 50%;
    height: 300px;
    margin: 0px;
    padding-bottom: 0px;
}

footer div#aboutme h3
{
    width: 80%;
    margin-left: 10%;
    padding-top: 20px;
}

footer div#aboutme p
{
    width: 80%;
    margin-left: 10%;
    padding-top: 15px;
}

footer div.rrss
{
    position: relative;
    width: 50%;
    height: 150px;
    margin: 0px;
    top: -300px;
    left: 50%;
    padding-bottom: 0px;
}

footer div.rrss p
{
    padding-top: 30px;
}

footer div.rrss a
{
    padding-top: 15px;
}

footer div.suscription
{
    position: relative;
    width: 50%;
    height: 150px;
    margin: 0px;
    top: -300px;
    margin-left: 50%;
    padding-bottom: 0px;
    text-align: center;
}

footer div.suscription p
{
    display: block;
    padding-top: 0px;
    padding-bottom: 30px;
}

footer div.suscription input:nth-of-type(1)
{
    max-width: 175px;
}

footer div.suscription input:nth-of-type(2)
{
    max-width: 125px;
    border: none;
    border-bottom: 1px solid white;
}

footer div#derechos
{
    position: relative;
    top: -299px;
}

footer div#derechos p
{
    position: relative;
    top: 15px;
}
<footer>
    <div id="aboutme">
        <h3>Acerca de mí...</h3>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
    </div>


    <div class="rrss">
        <p><strong>Encuentrame en:</strong></p>
        <a href="#"></a>
        <a href="" target="_blank"></a>
        <a href="" target="_blank"></a>
        <a href="#"></a>
    </div>

    <div class="suscription">
        <p>Recibe nuestras publicaciones en tu email.</p>
        <input type="mail" name="email" placeholder="Ingresa tu email" id="input_registro">
        <input type="button" id="button_registro" name="button_registro" value="Registrar">
    </div>

    <div id="derechos">
        <p>© 2018 All rights reserved | Privacity Policy</p>
    </div>

</footer>


    

1 个答案:

答案 0 :(得分:1)

这就是您的麻烦所在:

footer div.rrss
{
    position: relative;
    width: 50%;
    height: 150px;
    margin: 0px;
    top: -300px;
    left: 50%;
    padding-bottom: 0px;
}

Firefox在屏幕上将其向上移动,但没有释放该空间。

在页脚中添加overflow:hidden,以使其高度保持300px

footer 
{
    position: absolute;
    top: 2050px;
    height: 330px;
    overflow:hidden; /* will not keep space used by the relative element */
}

footer div#aboutme
{
    width: 50%;
    height: 300px;
    margin: 0px;
    padding-bottom: 0px;
}

footer div#aboutme h3
{
    width: 80%;
    margin-left: 10%;
    padding-top: 20px;
}

footer div#aboutme p
{
    width: 80%;
    margin-left: 10%;
    padding-top: 15px;
}

footer div.rrss
{
    position: relative;
    width: 50%;
    height: 150px;
    margin: 0px;
    top: -300px;
    left: 50%;
    padding-bottom: 0px;
}

footer div.rrss p
{
    padding-top: 30px;
}

footer div.rrss a
{
    padding-top: 15px;
}

footer div.suscription
{
    position: relative;
    width: 50%;
    height: 150px;
    margin: 0px;
    top: -300px;
    margin-left: 50%;
    padding-bottom: 0px;
    text-align: center;
}

footer div.suscription p
{
    display: block;
    padding-top: 0px;
    padding-bottom: 30px;
}

footer div.suscription input:nth-of-type(1)
{
    max-width: 175px;
}

footer div.suscription input:nth-of-type(2)
{
    max-width: 125px;
    border: none;
    border-bottom: 1px solid white;
}

footer div#derechos
{
    position: relative;
    top: -299px;
}

footer div#derechos p
{
    position: relative;
    top: 15px;
}
<footer>
    <div id="aboutme">
        <h3>Acerca de mí...</h3>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
    </div>


    <div class="rrss">
        <p><strong>Encuentrame en:</strong></p>
        <a href="#"></a>
        <a href="" target="_blank"></a>
        <a href="" target="_blank"></a>
        <a href="#"></a>
    </div>

    <div class="suscription">
        <p>Recibe nuestras publicaciones en tu email.</p>
        <input type="mail" name="email" placeholder="Ingresa tu email" id="input_registro">
        <input type="button" id="button_registro" name="button_registro" value="Registrar">
    </div>

    <div id="derechos">
        <p>© 2018 All rights reserved | Privacity Policy</p>
    </div>

</footer>

对于页脚的布局,您也可以考虑使用网格:

footer {
  position: absolute;
  top: 2050px;
  height: 350px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #444;
  color: white;
}

footer div#aboutme {
  grid-column: 1;
  grid-row: 1 / span 2;
}

footer div#aboutme h3 {
  width: 80%;
  margin-left: 10%;
  padding-top: 20px;
}

footer div#aboutme p {
  width: 80%;
  margin-left: 10%;
  padding-top: 15px;
}

footer div.rrss {
  grid-column: 2;
  grid-row: 1;
}

footer div.rrss p {
  padding-top: 30px;
}

footer div.rrss a {
  padding-top: 15px;
}

footer div.suscription {
  grid-column: 2;
  grid-row: 2;
}

footer div.suscription p {
  display: block;
  padding-top: 0px;
  padding-bottom: 30px;
}

footer div.suscription input:nth-of-type(1) {
  max-width: 175px;
}

footer div.suscription input:nth-of-type(2) {
  max-width: 125px;
  border: none;
  border-bottom: 1px solid white;
}

footer div#derechos {
  grid-row: 3;
  grid-column: 1 / span 2;
  margin: auto;
}

footer div#derechos p {}
<footer>
  <div id="aboutme">
    <h3>Acerca de mí...</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
      dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
  </div>


  <div class="rrss">
    <p><strong>Encuentrame en:</strong></p>
    <a href="#"></a>
    <a href="" target="_blank"></a>
    <a href="" target="_blank"></a>
    <a href="#"></a>
  </div>

  <div class="suscription">
    <p>Recibe nuestras publicaciones en tu email.</p>
    <input type="mail" name="email" placeholder="Ingresa tu email" id="input_registro">
    <input type="button" id="button_registro" name="button_registro" value="Registrar">
  </div>

  <div id="derechos">
    <p>© 2018 All rights reserved | Privacity Policy</p>
  </div>

</footer>