1、按层次结构分:form-group -> form-control/input-group/form-static-control -> 各类标签
2、Form-group/form-control/input-group/form-static-control之类的容器,分为两种显示方式:block、inline-block。而实现input-group水平用的是table-cell。
.input-group { display: inline-table; vertical-align: middle; .input-group-addon, .input-group-btn, .form-control { width: auto; } }
3、Input-group-addon:类如果插入网页文字图标,会向上一个像素的错位
解决方案:glyphicon不能与其他样式合并使用,而是内部嵌套使用即可,因为glyphicon对top有1个像素的设置:
.glyphicon { position: relative; top: 1px; display: inline-block; font-family: 'Glyphicons Halflings'; font-style: normal; font-weight: normal; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
二、导航条(navbar)
源码文件:
_navbar.scss
.navbar-toggle { position: relative; float: right; margin-right: $navbar-padding-horizontal; padding: 9px 10px; @include navbar-vertical-align(34px); background-color: transparent; background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214 border: 1px solid transparent; border-radius: $border-radius-base; // We remove the `outline` here, but later compensate by attaching `:hover` // styles to `:focus`. &:focus { outline: 0; } // Bars .icon-bar { display: block; width: 22px; height: 2px; border-radius: 1px; } .icon-bar + .icon-bar { margin-top: 4px; } @media (min-width: $grid-float-breakpoint) { display: none; } }9、Navbar-nav:原nav的基础进行了一些兼容设置,主是在breakpoint-max下的样式调整,以及在breakpointg下的样式调整,还是去掉默认的背景色,shadow等内容