Barra superior de Twitter Bootstrap HAML

I'm trying to create a topbar using twitter bootstrap, but the black bar won't render. I've got a simple rails app with haml-rails y less-rails-bootstrap.

I tried the following haml:

!!! 5
%html
   = render 'layouts/header'
   %body
     .topbar-wrapper
       .topbar
         .topbar-inner
           .container
             %a{:href => "brand", :href=>"#"} Name
     .container
       = yield

I had a look on SO and found the following post: Twitter Bootstrap css barra superior html / css I tried translating that HTML into haml, but this doesn't work either:

!!! 5
%html
  %body
    .topbar
      .topbar-inner
        .container
          %a{:class => "brand", :href =>"#"} Name

I can see the bootstrap styling, so I have included bootstrap and it is being rendered along with the page. I must be making some mistake in my haml.

preguntado el 01 de febrero de 12 a las 14:02

What version of Bootstrap are you using? 1.4 or 2.0? -

2.0, from gem less-rails-bootstrap 2.0.1 -

1 Respuestas

The HTML scaffold in Bootstrap 2.0 is different from the one proposed in 1.4:

<div class="navbar">
  <div class="navbar-inner">
    <div class="container">
      ...
    </div>
  </div>
</div>

In HAML this would be something like:

.navbar
  .navbar-inner
    .container
       ...

Puede encontrar más detalles en: http://twitter.github.com/bootstrap/components.html#navbar

Respondido 01 Feb 12, 18:02

I'm getting a better result using this but it's still not quite right, there is no black bar. I'm not overriding the styling anywhere else, am I missing something? - user130076

Whoops, I had written 'narbar' instead of 'navbar'. - user130076

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.