我試圖理解引導程序,我在http://getbootstrap.com/css/#less-variables的腳手架部分閱讀了文檔。在twitter引導中分配背景顏色3
這是我的簡化代碼,它不能工作。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>test</title>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js" />
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js" />
<![endif]-->
<style type="text/css">
@body-bg: #fff;
@text-color: @black-50;
</style>
</head>
<body>
hi
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" />
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js" />
</body>
</html>
如果由於某種原因,此解決方案不適合您,請在'background' /'background-color'末尾添加'!important'標籤,以確保它覆蓋引導程序的默認值。 – ProDexorite 2014-09-02 08:26:15
我喜歡鏈接頁面中的自定義方法,通過LESS構建更容易。但它也有它的弱點,我不能保持在我的git倉庫中的變化。 – 2014-09-02 08:49:44