Files
html5-restaurant/node_modules/jade-bootstrap/layouts/non-responsive.jade
2016-01-26 18:24:31 +01:00

78 lines
3.0 KiB
Plaintext

extends ../_bootstrap
append styles
// Custom styles for this template
link(href='/css/non-responsive.css', rel='stylesheet')
block body
// Fixed navbar
nav.navbar.navbar-default.navbar-fixed-top
.container
.navbar-header
// The mobile navbar-toggle button can be safely removed since you do not need it in a non-responsive implementation
a.navbar-brand(href='#') Project name
// Note that the .navbar-collapse and .collapse classes have been removed from the #navbar
#navbar
ul.nav.navbar-nav
li.active
a(href='#') Home
li
a(href='#about') About
li
a(href='#contact') Contact
li.dropdown
a.dropdown-toggle(href='#', data-toggle='dropdown', role='button', aria-expanded='false')
| Dropdown
span.caret
ul.dropdown-menu(role='menu')
li
a(href='#') Action
li
a(href='#') Another action
li
a(href='#') Something else here
li.divider
li.dropdown-header Nav header
li
a(href='#') Separated link
li
a(href='#') One more separated link
form.navbar-form.navbar-left(role='search')
.form-group
input.form-control(type='text', placeholder='Search')
button.btn.btn-default(type='submit') Submit
ul.nav.navbar-nav.navbar-right
li
a(href='#') Link
li
a(href='#') Link
li
a(href='#') Link
.container
.page-header
h1 Non-responsive Bootstrap
p.lead
| Disable the responsiveness of Bootstrap by fixing the width of the container and using the first grid system tier.
a(href='http://getbootstrap.com/getting-started/#disable-responsive') Read the documentation
| for more information.
h3 What changes
p
| Note the lack of the
code <meta name="viewport" content="width=device-width, initial-scale=1">
| , which disables the zooming aspect of sites in mobile devices. In addition, we reset our container's width and changed the navbar to prevent collapsing, and are basically good to go.
h3 Regarding navbars
p
| As a heads up, the navbar component is rather tricky here in that the styles for displaying it are rather specific and detailed. Overrides to ensure desktop styles display are not as performant or sleek as one would like. Just be aware there may be potential gotchas as you build on top of this example when using the navbar.
h3 Browsers, scrolling, and fixed elements
p
| Non-responsive layouts highlight a key drawback to fixed elements.
strong.text-danger
| Any fixed component, such as a fixed navbar, will not be scrollable when the viewport becomes narrower than the page content.
| In other words, given the non-responsive container width of 970px and a viewport of 800px, you'll potentially hide 170px of content.
p
| There is no way around this as it's default browser behavior. The only solution is a responsive layout or using a non-fixed element.
h3 Non-responsive grid system
.row
.col-xs-4 One third
.col-xs-4 One third
.col-xs-4 One third