Я пытаюсь использовать некоторые базовые бутстрапы на моем сайте, но это просто ничего не делает. я устанавливал «самозагрузки-Sass» драгоценный камень и написал код CSS в custom.css.sass но нет каких-либо изменений на сайте
Bootstrap 3 не загружается
Это файл custom.css.scss
@import "bootstrap-sprockets";
@import "bootstrap";
/*universal */
html{
overflow-y: scroll;
}
body {
padding-top: 60px;
}
section{
overflow : auto;
}
textarea {
resize: vertical;
}
.center{
tent-align : center
}
.center h1{
margin-bottom : 10px;
}
/* topography */
h1, h2, h3, h4, h5, h6 {
line-height : 1;
}
h1 {
font-size : 3em;
letter-spacing : -2px;
margin-bottom : 30px;
text-align : center;
}
h2{
font-size : 1.7em;
letter-spacing : -1px;
margin-bottom : 30px;
text-align : center;
font-weight : normal;
color : #999;
}
p {
font-size : 1.1em;
line-height : 1.7em;
}
/* header */
#logo{
float : left;
margin-right : 10px;
font-size : 1.7em;
color : #fff;
tex-transform : uppercase;
letter-spacing : -1px;
padding-top : 9px;
font-weight : bold;
line-height : 1;
}
#logo:hover {
color : #fff;
text-decoration : none;
}
Это application.html файл
<!DOCTYPE html>
<html>
<head>
<title><%= full_title(yield(:title)) %></title>
<%= stylesheet_link_tag 'default', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'default', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"> </script>
<![endif]-->
</head>
<body>
<header class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<%= link_to "samples app", '#', id: "logo" %>
<nav>
<ul class="nav pull-right">
<li><%= link_to "Home", '#' %></li>
<li><%= link_to "Help", '#' %></li>
<li><%= link_to "Sign in", '#' %></li>
</ul>
</nav>
</div>
</div>
</header>
<div class="container">
<%= yield %>
</div>
</body>
</html>
и это файл home.html
<div class="center jumbotron">
<h1>Welcome to the Sample App</h1>
<h2>
This is the home page for the
<a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
sample application.
</h2>
<%= link_to "Sign up now!", '#', class: "btn btn-large btn-primary" %>
</div>
<%= link_to image_tag("rails.png", alt: "Rails"), 'http://rubyonrails.org/' %>
application.css
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require_tree .
*= require_self
*/
В application.html
я chanaged (stylesheet_link_tag 'application'
к stylesheet_link_tag 'default'
) и (javascript_include_tag 'application'
к javascript_include_tag 'default'
), как это посылает сообщение об ошибке, как (Object оленья кожа этот метод поддержки)
Любые ошибки в вашем браузере dev tools console? –
У вас есть другие файлы css? Когда вы просматриваете сгенерированный источник в браузере и просматриваете файл css, что вы получаете? Может быть, 'custom.css' вообще не включается (зависит от' default.css'). Другая проблема может заключаться в том, что вы назвали свой файл '.css' вместо' .scss'. – wvengen
, пожалуйста, напишите файл application.css –