【问题标题】:My Divs are overlapping in Bootstrap 3我的 Div 在 Bootstrap 3 中重叠
【发布时间】:2014-03-06 09:46:05
【问题描述】:

我是 BootStrap 3 的新手,我的 div 重叠时遇到问题。我可能遗漏了一些简单的东西,但似乎找不到问题所在。这是html。

您还可以在 wibberding.info/SolarTime 上找到我在 Bootstrap 中尝试做的工作副本。

感谢您提供的任何帮助。

<!DOCTYPE html>
<html lang="en">
<head>  
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="script.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<title>Solar Time</title>
<link rel="icon" type="image/ico" href="favicon.ico">
</head>

<body>

<div class="jumbotron">
<div class="container clearfix">
<h1 id="clock">Solar Time</h1>
</div>
</div>

<div class="container">
<div class="row">
<div class="col-md-8">
<p>This web app allows you to find Solar Time in two ways:</p>
<p> 1. Find Solar Time by reading the location data from your device. You will have to have this turned on. </p>
<p> 2. By entering a longitude. You can find the longitude of your zipcode <a href="https://www.zipinfo.com/search/zipcode.htm" target="_blank">here</a>.</p>
</div>
<div class="col-md-4">
<form id="form">
<input id="device" type="radio" name="locationData" value="device" checked onchange="solarTime.checkLocationMethod()">
<label for="device">Use my device location.</label><br>

<input id="latLong" type="radio" name="locationData" value="latLong" onchange="solarTime.checkLocationMethod()">
<label for="latLong">Enter Longitude</label>
<input type="text"  size="10" maxlength="30" id="longitude" onFocus="solarTime.changeToLong()"></input> (Enter postive longitude for East and negative for West. All of the United States is negative.) <br>

<input type="button" onclick="solarTime.checkLocationMethod()" value="Find Solar Time" />
</form>
</div>
</div>

</div>
</body>
</html>

【问题讨论】:

  • 我快速浏览了一下,您对哪些 div 有疑问?
  • 您的表单元素可能超出了分区的宽度。尝试将它们包装在 bs 的表单容器中(即 .form-groups)。 (虽然光看这个很难说)getbootstrap.com/css/#forms
  • 仔细观察,我的行似乎也相互重叠。一切都想呈现在页面顶部。

标签: javascript html css twitter-bootstrap


【解决方案1】:

所以看起来我错过了一个结束 DIV 标记。它现在可以工作了:-) 谢谢大家的帮助。 . .

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-05
    相关资源
    最近更新 更多