html - CSS 布局 : Firefox vs. Chrome

标签 html css google-chrome firefox

<分区>


关闭 7 年前

我一直在使用 Chrome,它看起来(布局明智)就像我想要的那样。我切换到 Firefox,它完全不正确。

What Chrome shows

请看这个codepen(这是Firefox反射(reflect)的):

http://codepen.io/elCheapo/pen/jWmdqm/

IE 也相当不同。

<html>

<head>

  <link rel="stylesheet" href="reset.css">
  <link rel="stylesheet" href="main.css">

</head>

<body>


  <nav id="cHead">
    <p>ERIC WEST</p>
    <aside>Hamburger Menu?</aside>
  </nav>

  <section id="bgArt">

    <header>
      <p>ERIC</br>WEST</p>
    </header>
  </section>


  <nav id="about">
    <ul>
      <li><a href="about.html">About Me</a></li>
    </ul>
  </nav>

  <div id="blinkyArrow">

  </div>


</body>

</html>

    /*  body (alignment etc...)  */

body {
  margin: 0 auto;
  width: 640px;
  height: 1920px;
  outline: 2px solid black;
  background-color: #FFEED;
}


/* cHead nav */

#cHead {
  display: ;
  width: 100%;
  height: 5em;
  background-color: #37383B;
}

#cHead p {
  float: left;
  padding-top: .2em;
  padding-left: .5em;
  font: 70px "Kinesis Pro 3" Kinesis, serif;
  color: white;
  text-shadow: 2px 2px 6px #000;
  letter-spacing: .07em;
}

#cHead aside {
  float: right;
  margin: 2em
}


/* background */

#bgArt {
  position: relative;
  width: 100%;
  height: 100%;
}

#bgArt p {
  position: absolute;
  top: .8em;
  left: .15em;
  font: 13em "Kinesis Pro 3" Kinesis, serif;
  color: white;
  text-shadow: 4px 4px 15px #000;
  text-align: center;
  line-height: .9;
}

最佳答案

您需要为您的 p 标签应用边距

#cHead p {
  float: left;
  padding-top: .2em;
  padding-left: .5em;
  font: 70px "Kinesis Pro 3" Kinesis, serif;
  color: white;
  text-shadow: 2px 2px 6px #000;
  letter-spacing: .07em;
  margin: 0;
}

关于html - CSS 布局 : Firefox vs. Chrome,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34700257/

上一篇:php - 使用变量设置背景 URL - 我做错了什么?

下一篇:jquery - Bootstrap : Mouse-enter animation issue with img-responsive [Opera only]

相关文章:

java - selenium headless chrome java忽略ssl错误

html - Chrome 40 中的@Font-Face 渲染

javascript - HTML5 localStorage JSON 改进

html - 具有响应能力的垂直文本

javascript - 使用 Javascript 在最简单的 HTML 页面上延迟

css - 跨浏览器模糊背景?

html - 使嵌入的 Youtube 视频缩略图可打印(@media print)

html - Bootstrap : How to place button next to input-group

javascript - 用新颜色叠加图像

php - HTML 到 WordPress 转换页面