Analysis on how to use form and navbar in Bootstrap
This article mainly explains in detail how to use form and navbar in Bootstrap. Interested friends can refer to it
1. Form(Form)
Source code file:
_form.scss
mixins/_form.scss
1. According to the hierarchical structure: form-group -> form-control/input-group/form-static-control -> Various tags
2. Containers such as Form-group/form-control/input-group/form-static-control are divided into two types Display mode: block, inline-block. Table-cell is used to implement the input-group level.
.input-group { display: inline-table; vertical-align: middle; .input-group-addon, .input-group-btn, .form-control { width: auto; } }
3. Input-group-addon: If the web page text icon is inserted into the class, it will be displaced by one pixel.
Solution: glyphicon cannot be combined with other styles, but is nested internally. Yes, because glyphicon has a 1-pixel setting for top:
.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; }
## 2. Navigation bar (navbar)
Source code file:
_navbar.scss
2. Folder implementation (removed in 4.0), which is the navbar-collapse class. Instead of collapse, a hidden layer pops up on the button
2.1. Navbar-collapse: When it is greater than the breakpoint, it will Forced display (because collapse is hidden by default)
3. Content supports nav, brand, form, toggler
4. Navbar-toggler (removed in 4.0): set to display when the screen is smaller than the breakpoint value (768) , and in 4.0, collapse is used directly to display this button. There is no screen size limit. The application of navbar-toggle must also be used in combination with collapse.
5. Navbar-static-top: Just add zIndex and remove the rounded corners. Border width, etc.
6. Navbar-fixed-top/bottom: They are positioned above and below, with floating effects
7. Navbar-brand: Brand, you can put the web page name, company logo and other content
8. Navbar -toggle: The clicked image used for shrinking. It will be displayed when it is less than the breakpoint. If it is greater than this value, it will be hidden (and the toggle display is right-floating and used as a relatively positioned element):
.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; } }
10. Navbar-form: Mainly adjust all forms to be inline elements
11. Navbar-text, navbar-btn: All are compatible based on the default Settings
12. Navbar provides two themes: default and inverse. Each theme has corresponding style compatibility processing for its respective components.
13. The navigation bar itself does not have many styles, and it only provides toggle. , brand content, mainly provides two themes, and a combination of the four components dropdown, collapse, form, and nav.
How to use responsive tools using bootstrap
How to implement Table search box and query in Bootstrap
The above is the detailed content of Analysis on how to use form and navbar in Bootstrap. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Using Bootstrap in Vue.js is divided into five steps: Install Bootstrap. Import Bootstrap in main.js. Use the Bootstrap component directly in the template. Optional: Custom style. Optional: Use plug-ins.

How to use Bootstrap to get the value of the search bar: Determines the ID or name of the search bar. Use JavaScript to get DOM elements. Gets the value of the element. Perform the required actions.

Use Bootstrap to implement vertical centering: flexbox method: Use the d-flex, justify-content-center, and align-items-center classes to place elements in the flexbox container. align-items-center class method: For browsers that do not support flexbox, use the align-items-center class, provided that the parent element has a defined height.

To set up the Bootstrap framework, you need to follow these steps: 1. Reference the Bootstrap file via CDN; 2. Download and host the file on your own server; 3. Include the Bootstrap file in HTML; 4. Compile Sass/Less as needed; 5. Import a custom file (optional). Once setup is complete, you can use Bootstrap's grid systems, components, and styles to create responsive websites and applications.

There are two ways to create a Bootstrap split line: using the tag, which creates a horizontal split line. Use the CSS border property to create custom style split lines.

There are several ways to insert images in Bootstrap: insert images directly, using the HTML img tag. With the Bootstrap image component, you can provide responsive images and more styles. Set the image size, use the img-fluid class to make the image adaptable. Set the border, using the img-bordered class. Set the rounded corners and use the img-rounded class. Set the shadow, use the shadow class. Resize and position the image, using CSS style. Using the background image, use the background-image CSS property.

How to use the Bootstrap button? Introduce Bootstrap CSS to create button elements and add Bootstrap button class to add button text

To adjust the size of elements in Bootstrap, you can use the dimension class, which includes: adjusting width: .col-, .w-, .mw-adjust height: .h-, .min-h-, .max-h-
