html - 这个高度从何而来? Web 检查器不显示?

标签 html css twitter-bootstrap-3

如果你看一下标题,我在右侧有一个电话号码和一封电子邮件。现在出于某种原因,两者之间有这个空间,我完全不知道这个空间是从哪里来的?

我没有为此设置填充或高度,网络检查器只是没有为我显示它。

<html>
<head>
    <title>www.WebDesignGuy.com || Professional Website Design and Website Development Services</title>
    <link rel="stylesheet" type="text/css" href="css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="css/animate.css">
    <link rel="stylesheet" type="text/css" href="css/style.css">
</head>

<body>

<header>
    <div class="container">
        <div class="row">
            <div class="col-sm-6" id="logo_container">

                <img src="img/logo.png" id="top_logo">

            </div>

            <div class="col-sm-6" id="cta_header_box">

                <div id="telephone">
                    <img src="img/telephone_icon.png">
                    <p>085 816 2252</p>
                </div>

                <div id="email">
                    <img src="img/email_icon.png">
                    <p>info@webdesignguy.com</p>
                </div>

            </div>
        </div>
    </div>
</header>

<nav>
    <div class="container">
        <ul>
            <li><a href="">Home</a></li>
            <li><a href="">Testimonials</a></li>
            <li><a href="">Services</a></li>
            <li><a href="">Contact</a></li>
        </ul>
    </div>
</nav>


<script type="text/javascript" src="js/jQuery.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript" src="js/script.js"></script>
</body>
</html>

CSS

* {
  margin: 0;
  font-family: source sans pro;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  height: 100%;
  overflow: hidden;
}

/******* HEADER ****************** */
header {
  background-color: #057bad;
  padding-bottom: 10px;
}
header p {
  color: white;
}
header #telephone {
  margin-top: 10px;
  font-size: 31px;
  font-weight: 400;
  text-align: right;
}
header #telephone p {
  display: inline;
}
header #telephone img {
  position: relative;
  bottom: 5px;
  margin-right: 5px;
}
header #email {
  font-size: 16px;
  text-align: center;
  text-align: right;
}
header #email p {
  display: inline;
}
header #email img {
  position: relative;
  left: 3px;
  bottom: 3px;
  margin-right: 10px;
}

#top_logo {
  margin-top: 20px;
}

#cta_header_box {
  text-align: right;
}

/******* HEADER ****************** */
nav {
  background-color: #036994;
  padding: 5px 0;
}
nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
nav li {
  display: inline;
}
nav li a {
  color: white;
  text-decoration: none;
  margin-right: 30px;
  font-size: 1.2em;
}
nav li ahover {
  text-decoration: none;
  color: #057bad;
}

最佳答案

这个空间是因为你使用的 p 标签 set margin 0 for P p{ margin :0;}

关于html - 这个高度从何而来? Web 检查器不显示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32566836/

相关文章:

html - 如何完全删除右边距?

javascript - 强制用户到页面顶部?

html - 显示帮助文本时 Bootstrap 表单布局中断

html - 在 html 中显示 html

jquery - AJAX调用返回JSON,如何渲染正确格式的数据

python - 在 python 上用 html 格式化 flask 表输出

html - CSS 中的相对和绝对定位

javascript - 分割一个div元素

html - 为什么我的 bootstrap inputs 比他们的 parent div 大

css - 覆盖 Bootstrap 表条纹 CSS