我尝试使用bootstrap重建我的网站,但我目前面临早期阶段的问题,抵消不起作用,我一直在搜索有关此问题的几个主题问题,但没有一个解决方案适合我。 我还试过以前的syntaxe class =" col-md-4 col-md-offset-4"但它没有用,是否有更新的命令呢?
<!DOCTYPE html>
<html>
<head>
<!--Charset and Responsive -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<!--Bootstrap Css-->
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
</head>
<body>
<div class="container" style="margin:15% auto;">
<div class="row" style="background-color:black">
<div class="col-md-4 offset-md-4" style="background-color:green">
<div class="panel panel-default" >
<div class="panel-body">
<form method="post" id="logForm">
<div id="info"></div>
<div class="form-group">
<label for="email">Email</label>
<input type="text" id="email" name="email" placeholder="Email" class="form-control"/>
</div>
<div class="form-group">
<label for="pass">Mot de Passe</label>
<input type="password" id="pass" name="pass" placeholder="Mot de Passe" class="form-control"/>
</div>
<div class="form-group">
<input type="submit" id="login" name="login" value="Login" class="btn btn-primary"/>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>
</body>
</html>
&#13;
答案 0 :(得分:0)
终于找到了一个解决方案,有一个线程有完全相同的问题。 显然bootstrap 4.0 beta完全使用了flexbox,因此偏移量不再相同,请查看以下链接:Berkley