我正在尝试使用 rails 和 bootstrap-sass gem 创建我的投资组合网站,但我似乎无法让列布局正常工作。
这是一个 fiddle :http://jsfiddle.net/thyat/
我的样式表是空的,我的 haml 代码是
!!!
%html
%head
%title #{ full_title(yield(:title))}
= stylesheet_link_tag :application, :media => "all", "data-turbolinks-track" => true
= javascript_include_tag :application, "data-turbolinks-track" => true
= csrf_meta_tags
%meta{ "http-equiv" => "Content-Type", :content => "text/html; charset=utf-8" }
= render 'layouts/shim'
%body
.container
= render 'layouts/header'
= yield
= render 'layouts/footer'
页眉布局
.row
%header
.col-lg-2.col-md-2.logo-image
= image_tag 'https://s3-us-west-2.amazonaws.com/mikaimages/star.png', alt: 'Eight fold star'
.col-lg-4.col-md-4.logo-text
%p Mika
%p Kalathil
%nav.col-lg-6.col-md-6
搜索 fiddle 后进行编辑, Bootstrap 似乎没有设置 css 中的列。有人吗?
最佳答案
根据您的 fiddle ,您的 HTML 是基于 Bootstrap 3 编码的。 (引用col-md-2等)
但是,您的 CSS 似乎是基于 bootstrap 2.3.1。语法不同。 Bootstrap 2.3.1 使用 span2 代替。
您可能想引用 Bootstrap-sass gem 来安装 bootstrap 3。
关于css - Bootstrap 网格不能正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22083825/