The final results are as follows:
First you have to introduce Bootstrap and jquery.
Recommend a cdn:http://cdn.gbtags.com/index.html
Then you begin to write the HTML code. If you don't want to change the display, the CSS actually saves 2333.
Because the HTML code is much more divided into three sections and then last a whole HTML code
As shown first, implementing this effect requires understanding the following components of bootstrap
- Navigation bar
- Button
- Form
- Drop-down menu
In fact, there are a number of styles for the above components. We just need to know a little bit more. Please refer to the http://www.gbtags.com/api/bootstrap3.2/bootstrap-doc/components/index.html for more information.
ps:class{} Here is just comment not HTML code
PS2: Provides HTML files with an online case debug
Navigation bar and navigation bar logo layout
- <!--Create a bootstarp navigation bar and navigation logo layout--
- <nav Class="NavBar navbar-default">
- <div Class="Navbar-header">
- Do STH
- </div>
- </nav>
Navigation buttons
- <!--Create a button--
- <!--class{
- Navbar-toggle: Pass this button to JS can be clicked
- Collapsed: Do not combine navbar-collapse that is a default class. No seemingly no bug found.
- }
- Data-toggle= "collapse": Introducing the Collapse plugin
- data-target= "#navbar-gbtag": Which tab to jump/open when the button is clicked
- Aria-expanded= "false": auxiliary reading function. Settings for special people--
- <button type="button" class="Navbar-toggle collapsed" data-toggle ="collapse" data-target="#navbar-gbtag" aria-expanded="false" >
- <!--Add some icons and instructions to the button
- class{
- Sr-only: Hide this tag
- Incon-bar: Icon Style
- Try to change a standard style for Glyphicon Glyphicon-star
- }-->
- <span class="Sr-only"> point me </span>
- <span class="Icon-bar"></span>
- <span class="Icon-bar"></span>
- <span class="Icon-bar"></span>
- </button>
Form
- <div Class="Form-group">
- <!--class{
- Form-control: Set the width to 100% but we set the navbar-form in the parent element form so that the width gets some control.
- }-->
- <input type="Text" class="Form-control" placeholder= "Search" />
- </div><!--form Groups --
- <button Type="Submit" class="btn btn-default"> search </button >
- </form><!--forms --
Drop-down menu
- <li Class="dropdown">
- <!--class{
- Dropdown-toggle: Declare this to be a drop-down list. In fact, I didn't find the specific purpose of this class. Canceled and no bugs found
- span. caret{
- An icon of a small triangle
- Picture Style
- }
- }
- Data-toggle= "dropdown": a necessary property for introducing a drop-down menu component
- role= "button": Auxiliary declaration function. Declare this is a button--
- <a href= "#" Class= "Dropdown-toggle" data-toggle< Span class= "pun" >= "dropdown" role= "button" aria-haspopup= " True " aria-expanded=" false " > dropdown menu name <span Class= "caret" ></SPAN></A>
- <ul class="Dropdown-menu">
- <li><a href="">bootstrap</a></li>
- <!--class{
- Divider: Separator Line Style
- }
- role= "Separator": declares this element to be a divider--
- <li Role="Separator" class="Divider"></li>
- <li><a href=""> please follow the Geek tab </a></li>
- </ul><!-- drop-down menu--
Full content See link: http://www.gbtags.com/gb/share/5758.htm
"Fine-grained" how to create a responsive navigation bar based on Bootstrap