本篇文章给大家谈谈css–使用twitterbootstrap3将9列布局居中,以及推特页面布局的知识点,同时本文还将给你拓展css–使用TwitterBootstrap的中心表单、css–在twit
本篇文章给大家谈谈css – 使用twitter bootstrap 3将9列布局居中,以及推特页面布局的知识点,同时本文还将给你拓展css – 使用Twitter Bootstrap的中心表单、css – 在twitter-bootstrap中居中模态、css – 在开发过程中使用Twitter Bootstrap 3、css – 如何从右到左使用twitter-bootstrap?等相关知识,希望对各位有所帮助,不要忘了收藏本站喔。
本文目录一览:- css – 使用twitter bootstrap 3将9列布局居中(推特页面布局)
- css – 使用Twitter Bootstrap的中心表单
- css – 在twitter-bootstrap中居中模态
- css – 在开发过程中使用Twitter Bootstrap 3
- css – 如何从右到左使用twitter-bootstrap?
css – 使用twitter bootstrap 3将9列布局居中(推特页面布局)
<div> <div> <div></div> <div></div> <div></div> </div> <div> <div></div> <div></div> </div> </div>
我想将这些9列和4列居中.用bootstrap做正确的方法是什么.
我尝试了第二种情况
<div> <div></div> <div></div> </div>
有用.我该怎么用来居中第一排的9列.
解决方法
<div> <div> <div> <div> <div></div> <div></div> <div></div> </div> </div> </div> <div> <div></div> <div></div> </div> </div>
演示:http://bootply.com/HKy0mPMXv5
css – 使用Twitter Bootstrap的中心表单
这是我的HTML:
<!DOCTYPE html> <html lang="en"> <head> <Meta charset="utf-8"> <title>My Form</title> <Meta name="viewport" content="width=device-width,initial-scale=1.0"> <Meta name="description" content=""> <Meta name="author" content=""> <!-- Le styles --> <link href="/bootstrap/css/bootstrap.css" rel="stylesheet"> <style> body { padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */ } </style> <link href="/bootstrap/css/bootstrap-responsive.css" rel="stylesheet"> <!-- Le HTML5 shim,for IE6-8 support of HTML5 elements --> <!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> <div> <div> <div> <formmethod="post" action="/form/"> <fieldset> <legend>Please login</legend> <div> <labelfor="id_username">Username</label> <div> <input name="username" maxlength="100" placeholder="Enter your username..." type="text"id="id_username" /> </div> </div> <div> <labelfor="id_password">Password</label> <div> <input name="password" maxlength="100" placeholder="Enter your password..." type="password"id="id_password" /> </div> </div> </fieldset> </form> </div> </div> </div> <!-- Le javascript ================================================== --> <!-- Placed at the end of the document so the pages load faster --> <script src="/bootstrap/js/jquery.js"></script> <script src="/bootstrap/js/bootstrap-transition.js"></script> <script src="/bootstrap/js/bootstrap-alert.js"></script> <script src="/bootstrap/js/bootstrap-modal.js"></script> </body> </html>
我已经排除了一些额外的django逻辑({%csrf_token%},一些if语句等),但这应该重新创建该问题。
实际的输入元素(用户名和密码文本框)正如我预期的那样居中,但标签仍然留在页面的最左侧。我在某处丢失标记,还是要覆盖某些控件标签CSS?
解决方法
<div> <div> <div> <formmethod="post" action="/form/"> <fieldset> <legend>Please login</legend> <div> <labelfor="id_username">Username</label> <div> <input name="username" maxlength="100" placeholder="Enter your username..." type="text"id="id_username" /> </div> </div> <div> <labelfor="id_password">Password</label> <div> <input name="password" maxlength="100" placeholder="Enter your password..." type="password"id="id_password" /> </div> </div> </fieldset> </form> </div> </div> </div>
css – 在twitter-bootstrap中居中模态
.modal:
.modal { position: fixed; top: 10%; z-index: 1050; width: auto; background-color: #ffffff; border: 1px solid #999; border: 1px solid rgba(0,0.3); *border: 1px solid #999; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; outline: none; -webkit-Box-shadow: 0 3px 7px rgba(0,0.3); -moz-Box-shadow: 0 3px 7px rgba(0,0.3); Box-shadow: 0 3px 7px rgba(0,0.3); -webkit-background-clip: padding-Box; -moz-background-clip: padding-Box; background-clip: padding-Box; }
.modal体:
.modal-body { margin: 0 auto 0 auto; position: relative; padding: 15px; overflow-y: auto; }
解决方法
$("#yourModal").modal('show').css({ 'margin-top': function () { //vertical centering return -($(this).height() / 2); },'margin-left': function () { //Horizontal centering return -($(this).width() / 2); } });
css – 在开发过程中使用Twitter Bootstrap 3
这是一个相当广泛的问题,但我真的无法将标题缩小到更多.
我已经下载了Bootstrap 3,我在运行grunt watch时对variables.less进行了自定义.每当我对LESS进行更改时,grunt都会将所有内容重新编译到dist目录中,然后将其复制到目标静态目录中.所有这一切都很好,但……
>这真的是预期的做法吗?我应该将Bootstrap源目录移动到其他目录以更有效地工作吗?
>如果我想添加一些自定义LESS用于表示,例如“当屏幕为@ screen-md像素时,隐藏所有img元素”,如何在我的自定义LESS文件中访问@ screen-md?
任何提示都非常感谢,因为我发现文档确实缺乏.
我正在使用bower来更新Bootstrap,所以我的文件夹结构是这样的:
> bower_components
> bootstrap
> font-awesome
> requirejs
...
> css
- project.css
> less
- project.less
- variables.less
我的project.less看起来像这样:
// Bootstrap framework
@import "../../bower_components/bootstrap/less/bootstrap.less";
// Font-awesome awesomeness
@import "../../bower_components/font-awesome/less/font-awesome.less";
// Project specific stuff
@import "variables.less";
@import "stuff.less";
我定义了我的变量并在我的变量中覆盖了bootstrap特定的变量.
// Override Bootstrap variables
@font-family-sans-serif: "Lucida Grande","Lucida Sans Unicode",Arial,sans-serif;
@btn-default-border: #bbb;
@brand-primary: #b02b2c;
@link-color: #08c;
// Override Font-Awesome variables (path relative to project.css position)
@fa-font-path: "../bower_components/font-awesome/fonts";
//Map Bootstrap variables to myproject specific names
@my-customname-float-breakpoint: @grid-float-breakpoint;
@theme-color: @brand-primary;
//Project specific variables
@my-favourite-color: rgb(228,1,1);
然后我只编译project.less来生成一个包含所有内容的压缩.css(在示例中还有Font Awesome).
在使用Bootstrap 3更新巨大的变量和类之后,有时我觉得将自定义变量映射到变量中的引导变量更好,而不是在我的less文件中直接使用Bootstrap.
导入bootstrap.less您可以在任何地方使用任何引导变量.所以,例如:
// Hide all images at a viewport smaller than 992px (aka @screen-md)
@media (max-width: @screen-sm-max) {
img {
display: none;
}
}
css – 如何从右到左使用twitter-bootstrap?
解决方法
<div> <div></div> <div></div> </div>
你也可以这样做:
<div> <div></div> </div>
关于css – 使用twitter bootstrap 3将9列布局居中和推特页面布局的问题我们已经讲解完毕,感谢您的阅读,如果还想了解更多关于css – 使用Twitter Bootstrap的中心表单、css – 在twitter-bootstrap中居中模态、css – 在开发过程中使用Twitter Bootstrap 3、css – 如何从右到左使用twitter-bootstrap?等相关内容,可以在本站寻找。
本文标签: