通过引导程序中心注册表格

https://img1.sycdn.imooc.com/6576bdf90001a1f503860590.jpg

我的代码是:<div class="col-md-4 col-md-offset-3">我是 Bootstrap 的新手。表格位于左侧,我希望它现在位于中心,我尝试了使用不同数字的 col-md col-xl 。



慕无忌1623718
浏览 118回答 1
1回答

蝴蝶刀刀

col-md-offset-3如果您必须添加该类,则必须删除类并改为 id m-auto。你的表格就变成了宽度的中心。这是为了您更好地理解的演示片段。.form_content {&nbsp; background-color: red;&nbsp; height: 200px;&nbsp; width: 100%;}<!DOCTYPE html><html><head>&nbsp; <meta charset="utf-8">&nbsp; <meta name="viewport" content="width=device-width, initial-scale=1">&nbsp; <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">&nbsp; <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>&nbsp; <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>&nbsp; <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script></head><body>&nbsp; <div class="container-fluid">&nbsp; &nbsp; <div class="row">&nbsp; &nbsp; &nbsp; <div class="col-md-4 m-auto">&nbsp; &nbsp; &nbsp; &nbsp; <div class="form_content"></div>&nbsp; &nbsp; &nbsp; </div>&nbsp; &nbsp; </div>&nbsp; </div></body></html>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Html5