Class with whitespace in jade.js templating
-
28-10-2019 - |
题
I'm toying around with jade.js and "Bootstrap, from twitter". Bootstrap has some classes with names that got whitespaces such as "nav secondary-nav".
In jade.js you define a div with div.classname but I can't do it like div.class name, anyone knows how I can do this some other way?
Thanks
解决方案
the class name 'secondary nav' should be 'secondary-nav'
jade syntax would be:
ul.nav.secondary-nav
example (bootstrap 2.0):
div(data-scrollspy='scrollspy').navbar.navbar-fixed
div.navbar-inner
div.container
a(href='/').brand www.sample.com
ul.nav
li.active
a(href='/') Home
li
a(href='/listing') Listing
ul.nav.secondary-nav
li
a(href='/account') Account
li
a(href='/logout') Logout
不隶属于 StackOverflow