【发布时间】:2014-06-18 07:08:39
【问题描述】:
您好,我正在将 Bootstrap 与 Drupal 一起使用。我已经安装了 Drupal 提供的 bootstrap 子主题,但是如果我使用我的 style.css 来应用我的设计更改,则 bootstrap 的默认样式不会被覆盖。
有谁知道如何覆盖这些默认样式? 我用的是Bootstrap CDN,知道什么意思的朋友,在官方教程中称为方法2。
PS:
指定类或使用 !important 不起作用!
根据评论中的要求:
我使用了与本教程中所述完全相同的结构: https://drupal.org/node/1978010)
这是我的信息文件的代码:
name = Bootstrap Sub-theme
description = A Bootstrap Sub-theme.
core = 7.x
base theme = bootstrap
;;;;;;;;;;;;;;;;;;;;;
;; Regions
;;;;;;;;;;;;;;;;;;;;;
regions[navigation] = 'Navigation'
regions[header] = 'Top Bar'
regions[highlighted] = 'Highlighted'
regions[help] = 'Help'
regions[content] = 'Content'
regions[sidebar_first] = 'Primary'
regions[sidebar_second] = 'Secondary'
regions[footer] = 'Footer'
regions[page_top] = 'Page top'
regions[page_bottom] = 'Page bottom'
;;;;;;;;;;;;;;;;;;;;;
;; Stylesheets
;;;;;;;;;;;;;;;;;;;;;
stylesheets[all][] = css/style.css
; For information on choosing the desired method, please read the Drupal
; Bootstrap sub-theme "how-to" documentation:
; https://drupal.org/node/1978010
; ;----------------------------------
; ; METHOD 1: Bootstrap Source Files
; ;----------------------------------
;
;
;
; ; Disable BootstrapCDN if using Bootstrap source files in your sub-theme.
; settings[bootstrap_cdn] = ''
; ;-------------------------
; ; METHOD 2: Bootstrap CDN
; ;-------------------------
;
Method 2 uses BootstrapCDN, the only thing you might need to provide here
; is overrides to Bootstrap theme settings. Copy them here from the base theme
; to override.
【问题讨论】:
-
你能告诉我们你的主题的结构和你的子主题的 .info 文件吗?
-
我将代码添加到我之前的帖子中。谢谢
-
还在寻找答案吗?任何人?请...
-
你的样式有可能被 Bootstrap 覆盖了吗? Bootstrap 可以更直接地针对这些元素。