Bootstrap practical code fragment one of _javascript tips

Source: Internet
Author: User
Tags button type wrapper

Title, continue to summarize their use of bootstrap problems encountered, and record the solution, hoping to help the needs of small partners.

scenario: Classic Upper and lower layout, top navigation bar fixed, bottom padding does not show scroll bar

Solution: navigation bar fixed at the top, while the body set the internal margin (padding-top), the interior margin for the navigation bar height (the default 50px, you can adjust the height), the HTML code is as follows:

<!--HTML page layout--> <div class= "Container-fluid page-wrapper" > <!--navigation bar--> <div "class=" Navbar-default navbar-fixed-top "role=" navigation "> <div class=" container "> <!--logo icon--> <div c lass= "Navbar-header" > <button type= "button" class= "Navbar-toggle collapsed" data-toggle= "collapse" data-target = "#myMenu" > <span class= "sr-only" > Toggle navigation bar </span> <span class= "Icon-bar" ></span> <spa n class= "Icon-bar" ></span> <span class= "Icon-bar" ></span> </button> <a class= "NavBar"
   -brand "href=" ">  </a> </div> <!--navigation bar Menu--> <div class= "Collapse navbar-collapse" id= "MyMenu" > <ul class= "Nav navbar-nav" > <li> A href= "index.html" style= "" > Home </a> </li> <li> <a href= "#" data-toggle= "modal"
  ; River Sites </a> </li>   <li> <a href= "#" data-toggle= "modal" > Reservoir site </a> </li> <li> <a href = "#" > Weather station point </a> </li> <li> <a href= "#" class= "Dropdown-toggle" data-toggle= "dropdown 
      "role=" button "aria-haspopup=" true "aria-expanded=" false "> Rainfall <span class=" caret "></span> </a> <ul class= "Dropdown-menu" > <li> <a data-toggle= "modal" >1 hour rainfall </a> < /li> <li> <a href= "#" >3 hour rainfall </a> </li> <li> <a HRE f= "#" >24 hours rain </a> </li> </ul> </li> </ul> <form class= "Navba R-form navbar-left "role=" Search > <div class= "Form-group" > <input type= "text" id= "DateTimePicker" class= "Form-control" placeholder= "Select Date" > </div> <button type= "button" class= "Btn Btn-default" > OK & Lt;/button> </form> </div> </div> </div> <!--map window--> <div class= "Container-fluid" id= "map" ></

 div> </div> </body>  

CSS code:

*{
margin:0;
padding:0;
border:0;
}
HTML, body{
height:100%;
width:100%;
Overflow:hidden;
}
body{
padding-top:50px
}
. page-wrapper{
margin:0;
padding:0;
height:100%;
Overflow:hidden;
}
#map {
width:100%;
height:100%;
}

Implementation effect:

If you want to further study, you can click here to learn, and then attach two wonderful topics: Bootstrap Learning Tutorials Bootstrap Practical course

I hope this article will help you to learn bootstrap.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.