我的CSS是从哪里来的?

3
我正在Drupal中为我的妻子创建一个商店。虽然这不是我的第一个Drupal网站,但是它是我的第一个商店,因此除了一些更改之外,我保持了基本的设置,因为我不是一个网页设计人员。
使用Firebug,我找到了div并能够在必要时更改颜色。
现在我需要进行一项更改,但我找不到问题所在。
如果我在Firebug中打开要更改背景颜色的表格,我可以查看css:

Firebug

正如您所看到的,背景颜色显示为透明。

如果我单击Firebug显示CSS来自哪里的链接,它会指向

http://10.0.1.151/sites/default/files/css - 那里的文件看起来像是CSS的缓存,因为它们具有非常近期的时间和日期。

如果我使用Firebug暂时更改背景颜色:

Firebug 2

这个表格看起来和我想要的一样。

所以我的问题是,如何将这个更改应用到样式表中,使其成为永久性的更改?

提前感谢您的帮助。

安德鲁

PS. 我删掉了样式表底部的一些内容,因为我是新手,网站不让我发更多。

下面是 style.css 的副本:

/* $Id: style.css,v 1.1.2.11 2010/07/02 22:11:04 sociotech Exp $ */


/* Margin, Padding, Border Resets

-------------------------------------------------------------- */

html, body, div, span, p,

dl, dt, dd, ul, ol, li,

h1, h2, h3, h4, h5, h6,

form, fieldset, input, textarea {

  margin: 0;

  padding: 0;

}



img, abbr, acronym {

  border: 0;

}





/* HTML Elements

-------------------------------------------------------------- */

p {

  margin: 1em 0;

}



h1, h2, h3, h4, h5, h6 {

  margin: 0 0 0.5em 0;

}



ul, ol, dd {

  margin-bottom: 1.5em;

  margin-left: 2em; /* LTR */

}



li ul, li ol {

  margin-bottom: 0;

}



ul {

  list-style-type: disc;

}



ol {

  list-style-type: decimal;

}



a {

  margin: 0;

  padding: 0;

  text-decoration: none;

}



a:link,

a:visited {

}



a:hover,

a:focus,

a:active {

  text-decoration: underline;

}



blockquote {

}



hr {

  height: 1px;

  border: 1px solid gray;

}



/* tables */

table {

  border-spacing: 0;

  width: 100%;

}



caption {

  text-align: left;

}



th {

  margin: 0;

  padding: 0 10px 0 0;

}



th.active img {

  display: inline;

}



thead th {

  padding-right: 10px;

}



td {

  margin: 0;

  padding: 3px;

}



/* Remove grid block styles from Drupal's table ".block" class */

td.block {

  border: none;

  float: none;

  margin: 0;

}



/* Maintain light background/dark text on dragged table rows */

tr.drag td,

tr.drag-previous td {

  background: #FFFFDD;

  color: #000;

}





/* Accessibility

/-------------------------------------------------------------- */

/* skip-link to main content, hide offscreen */

#skip a,

#skip a:hover,

#skip a:visited {

  height: 1px;

  left: 0px;

  overflow: hidden;

  position: absolute;

  top: -500px;

  width: 1px;

}



/* make skip link visible when selected */

#skip a:active,

#skip a:focus {

  background-color: #fff;

  color: #000;

  height: auto;

  padding: 5px 10px;

  position: absolute;

  top: 0;

  width: auto;

  z-index: 99;

}



#skip a:hover {

  text-decoration: none;

}





/* Helper Classes

/-------------------------------------------------------------- */

.hide {

  display: none;

  visibility: hidden;

}



.left {

  float: left;

}



.right {

  float: right;

}



.clear {

  clear: both;

}



/* clear floats after an element */

/* (also in ie6-fixes.css, ie7-fixes.css) */

.clearfix:after,

.clearfix .inner:after {

  clear: both;

  content: ".";

  display: block;

  font-size: 0;

  height: 0;

  line-height: 0;

  overflow: auto;

  visibility: hidden;

}





/* Grid Layout Basics (specifics in 'gridnn_x.css')

-------------------------------------------------------------- */

/* center page and full rows: override this for left-aligned page */

.page,

.row {

  margin: 0 auto;

}



/* fix layout/background display on floated elements */

.row,

.nested,

.block {

  overflow: hidden;

}



/* full-width row wrapper */

div.full-width {

  width: 100%;

}



/* float, un-center & expand nested rows */

.nested {

  float: left; /* LTR */

  margin: 0;

  width: 100%;

}



/* allow Superfish menus to overflow */

#sidebar-first.nested,

#sidebar-last.nested,

div.superfish {

  overflow: visible;

}



/* sidebar layouts */

.sidebars-both-first .content-group {

  float: right; /* LTR */

}



.sidebars-both-last .sidebar-first {

  float: right; /* LTR */

}



/* Grid Mask Overlay

-------------------------------------------------------------- */

#grid-mask-overlay {

  display: none;

  left: 0;

  opacity: 0.75;

  position: absolute;

  top: 0;

  width: 100%;

  z-index: 997;

}



#grid-mask-overlay .row {

  margin: 0 auto;

}



#grid-mask-overlay .block .inner {

  background-color: #e3fffc;

  outline: none;

}



.grid-mask #grid-mask-overlay {

  display: block;

}



.grid-mask .block {

  overflow: visible;

}



.grid-mask .block .inner {

  outline: #f00 dashed 1px;

}



#grid-mask-toggle {

  background-color: #777;

  border: 2px outset #fff;

  color: #fff;

  cursor: pointer;

  font-variant: small-caps;

  font-weight: normal;

  left: 0;

  -moz-border-radius: 5px;

  padding: 0 5px 2px 5px;

  position: absolute;

  text-align: center;

  top: 22px;

  -webkit-border-radius: 5px;

  z-index: 998;

}



#grid-mask-toggle.grid-on {

  border-style: inset;

  font-weight: bold;

}





/* Site Info

-------------------------------------------------------------- */

#header-site-info {

  width: auto;

}



#site-name-wrapper {

  float: left;   /* LTR */

}



#site-name,

#slogan {

  display: block;

}



#site-name a:link,

#site-name a:visited,

#site-name a:hover,

#site-name a:active {

  text-decoration: none;

}



#site-name a {

  outline: 0;

}





/* Regions

-------------------------------------------------------------- */



/* Header Regions

-------------------------------------------------------------- */

#header-group {

  overflow: visible;

}



/* Content Regions (Main)

-------------------------------------------------------------- */

.node-bottom {

  margin: 1.5em 0 0 0;

}



/*  Clear floats on regions

-------------------------------------------------------------- */

#header-top-wrapper,

#header-group-wrapper,

#preface-top-wrapper,

#main-wrapper,

#preface-bottom,

#content-top,

#content-region,

#content-bottom,

#postscript-top,

#postscript-bottom-wrapper,

#footer-wrapper,

#footer-message-wrapper {

  clear: both;

}





/* Drupal Core

/-------------------------------------------------------------- */



/* Lists

/-------------------------------------------------------------- */

.item-list ul li {

  margin: 0;

}



.block ul,

.block ol {

  margin-left: 2em; /* LTR */

  padding: 0;

}



.content-inner ul,

.content-inner ol {

  margin-bottom: 1.5em;

}



.content-inner li ul,

.content-inner li ol {

  margin-bottom: 0;

}



.block ul.links {

  margin-left: 0; /* LTR */

}



/* Menus

/-------------------------------------------------------------- */

ul.menu li,

ul.links li {

  margin: 0;

  padding: 0;

}



/* Primary Menu

/-------------------------------------------------------------- */

/* use ID to override overflow: hidden for .block, dropdowns should always be visible */

#primary-menu {

  overflow: visible;

}



/* remove left margin from primary menu list */

#primary-menu.block ul {

  margin-left: 0; /* LTR */

}



/* remove bullets, float left */

.primary-menu ul li {

  float: left; /* LTR */

  list-style: none;

  position: relative;

}



/* style links, and unlinked parent items (via Special Menu Items module) */

.primary-menu ul li a,

.primary-menu ul li .nolink {

  display: block;

  padding: 0.75em 1em;

  text-decoration: none;

}



/* Add cursor style for unlinked parent menu items */

.primary-menu ul li .nolink {

  cursor: default;

}



/* remove outline */

.primary-menu ul li:hover,

.primary-menu ul li.sfHover,

.primary-menu ul a:focus,

.primary-menu ul a:hover,

.primary-menu ul a:active {

  outline: 0;

}



/* Secondary Menu

/-------------------------------------------------------------- */

.secondary-menu-inner ul.links {

  margin-left: 0; /* LTR */

}





/* Skinr styles

/-------------------------------------------------------------- */



/* Skinr selectable helper classes */

.fusion-clear {

  clear: both;

}



div.fusion-right {

  float: right; /* LTR */

}



div.fusion-center {

  float: none;

  margin-left: auto;

  margin-right: auto;

}



.fusion-center-content .inner {

  text-align: center;

}



.fusion-center-content .inner ul.menu {

  display: inline-block;

  text-align: center;

}



/* required to override drupal core */

.fusion-center-content #user-login-form {

  text-align: center;

}



.fusion-right-content .inner {

  text-align: right; /* LTR */

}



/* required to override drupal core */

.fusion-right-content #user-login-form {

  text-align: right; /* LTR */

}



/* Large, bold callout text style */

.fusion-callout .inner {

  font-weight: bold;

}



/* Extra padding on block */

.fusion-padding .inner {

  padding: 30px;

}



/* Adds 1px border and padding */

.fusion-border .inner {

  border-width: 1px;

  border-style: solid;

  padding: 10px;

}



/* Single line menu with separators */

.fusion-inline-menu .inner ul.menu {

  margin-left: 0; /* LTR */

}



.fusion-inline-menu .inner ul.menu li {

  border-right-style: solid;

  border-right-width: 1px;

  display: inline;

  margin: 0;

  padding: 0;

  white-space: nowrap;

}



.fusion-inline-menu .inner ul.menu li a {

  padding: 0 8px 0 5px; /* LTR */

}



.fusion-inline-menu .inner ul li.last {

  border: none;

}



/* Hide second level (and beyond) menu items */

.fusion-inline-menu .inner ul li.expanded ul {

  display: none;

}



/* Multi-column menu style with bolded top level menu items */

.fusion-multicol-menu .inner ul {

  margin-left: 0; /* LTR */

  text-align: left; /* LTR */

}



.fusion-multicol-menu .inner ul li {

  border-right: none;

  display: block;

  font-weight: bold;

}



.fusion-multicol-menu .inner ul li.last {

  border-right: none;

}



.fusion-multicol-menu .inner ul li.last a {

  padding-right: 0; /* LTR */

}



.fusion-multicol-menu .inner ul li.expanded,

.fusion-multicol-menu .inner ul li.leaf {

  float: left; /* LTR */

  list-style-image: none;

  margin-left: 50px; /* LTR */

}



.fusion-multicol-menu .inner ul.menu li.first {

  margin-left: 0; /* LTR */

}



.fusion-multicol-menu .inner ul li.expanded li.leaf {

  float: none;

  margin-left: 0; /* LTR */

}



.fusion-multicol-menu .inner ul li.expanded ul {

  display: block;

  margin-left: 0; /* LTR */

}



.fusion-multicol-menu .inner ul li.expanded ul li {

  border: none;

  margin-left: 0; /* LTR */

  text-align: left; /* LTR */

}



.fusion-multicol-menu .inner ul.menu li ul.menu li {

  font-weight: normal;

}



/* Split list across multiple columns */

.fusion-2-col-list .inner .item-list ul li,

.fusion-2-col-list .inner ul.menu li {

  float: left; /* LTR */

  width: 50%;

}



.fusion-3-col-list .inner .item-list ul li,

.fusion-3-col-list .inner ul.menu li {

  float: left; /* LTR */

  width: 33%;

}



.fusion-2-col-list .inner .item-list ul.pager li,

.fusion-3-col-list .inner .item-list ul.pager li {

  float: none;

  width: auto;

}



/* List with bottom border

    Fixes a common issue when list items have bottom borders and appear to be

    doubled when nested lists end and begin. This removes the extra border-bottom

 */

.fusion-list-bottom-border .inner ul li {

  list-style: none;

  list-style-type: none;

  list-style-image: none;

}



.fusion-list-bottom-border .inner ul li,

.fusion-list-bottom-border .view-content div.views-row {

  padding: 0 0 0 10px; /* LTR */

  border-bottom-style: solid;

  border-bottom-width: 1px;

  line-height: 216.7%; /* 26px */

}



.fusion-list-bottom-border .inner ul {

  margin: 0;

}



.fusion-list-bottom-border .inner ul li ul {

  border-bottom-style: solid;

  border-bottom-width: 1px;

}



.fusion-list-bottom-border .inner ul li ul li.last {

  border-bottom-style: solid;

  border-bottom-width: 1px;

  margin-bottom: -1px;

  margin-top: -1px;

}



/*Andrew

*/

#views_slideshow_singleframe_pager_slideshow-page_2 .pager-item {

display:block;

}



#views_slideshow_singleframe_pager_slideshow-page_2 {

position:absolute;

right:0;

top:0;

}



#header-group-wrapper {

background-color:#92bbe9;

}



#main-wrapper {

background-color:#F3F3F3;

background-image:url('http://10.0.1.151/sites/all/themes/fusion/fusion_core/images/backgroundmain.jpg');

background-repeat:no-repeat;

background-attachment: fixed;

width: auto;

}



/.front {

/background-color:#F3F3F3;

/background-image:url('http://10.0.1.151/sites/all/themes/fusion/fusion_core/images/background.jpg');

/background-repeat:no-repeat;

/background-attachment: fixed;

/width: auto;

/}



#views_slideshow_singleframe_pager_slideshow-page_2 div a img {

top:0px;

height:60px;

width:80px;

padding-right:10px;

padding-bottom:19px;

}



#mycontent{

width: 720px;

}



#block-views-new_products-block_1{

height:200px;

}



/* List with no bullet and extra padding

    This is a common style for menus, which removes the bullet and adds more

    vertical padding for a simple list style

 */

.fusion-list-vertical-spacing .inner ul,

.fusion-list-vertical-spacing div.views-row-first {

  margin-left: 0;

  margin-top: 10px;

}



.fusion-list-vertical-spacing .inner ul li,

.fusion-list-vertical-spacing div.views-row {

  line-height: 133.3%; /* 16px/12px */

  margin-bottom: 10px;

  padding: 0;

}



.fusion-list-vertical-spacing .inner ul li {

  list-style: none;

  list-style-image: none;

  list-style-type: none;

}



.fusion-list-vertical-spacing .inner ul li ul {

  margin-left: 10px; /* LTR */

}



/* Bold all links */

.fusion-bold-links .inner a {

  font-weight: bold;

}



/* Float imagefield images left and add margin */

.fusion-float-imagefield-left .field-type-filefield,

.fusion-float-imagefield-left .image-insert,

.fusion-float-imagefield-left .imagecache {

  float: left; /* LTR */

  margin: 0 15px 15px 0; /* LTR */

}



/* Clear float on new Views item so each row drops to a new line */

.fusion-float-imagefield-left .views-row {

  clear: left; /* LTR */

}



/* Float imagefield images right and add margin */

.fusion-float-imagefield-right .field-type-filefield,

.fusion-float-imagefield-right .image-insert

.fusion-float-imagefield-right .imagecache {

  float: right; /* LTR */

  margin: 0 0 15px 15px; /* LTR */

}



/* Clear float on new Views item so each row drops to a new line */

.fusion-float-imagefield-right .views-row {

  clear: right; /* LTR */

}



/* Superfish: all menus */

.sf-menu li {

  list-style: none;

  list-style-image: none;

  list-style-type: none;

}



/* Superfish: vertical menus */

.superfish-vertical {

  position: relative;

  z-index: 9;

}



ul.sf-vertical {

  background: #fafafa;

  margin: 0;

  width: 100%;

}



ul.sf-vertical li {

  border-bottom: 1px solid #ccc;

  font-weight: bold;

  line-height: 200%; /* 24px */

  padding: 0;

  width: 100%;

}



ul.sf-vertical li a:link,

ul.sf-vertical li a:visited,

ul.sf-vertical li .nolink {

  margin-left: 10px;

  padding: 2px;

}



ul.sf-vertical li a:hover,

ul.sf-vertical li a.active {

  text-decoration: underline;

}



ul.sf-vertical li ul {

  background: #fafafa;

  border-top: 1px solid #ccc;

  margin-left: 0;

  width: 150px;

}



ul.sf-vertical li ul li.last {

  border-top: 1px solid #ccc;

  margin-bottom: -1px;

  margin-top: -1px;

}



ul.sf-vertical li ul {

  border-top: none;

  padding: 4px 0;

}



ul.sf-vertical li ul li {

  border-bottom: none;

  line-height: 150%; /* 24px */

}



ul.sf-vertical li ul li.last {

  border-top: none;

}



ul.sf-vertical li ul li ul {

  margin-top: -4px;

}





/* Pagers

-------------------------------------------------------------- */

ul.pager {

  margin: 20px 0;

}



ul.pager li {

  margin: 0;

  white-space: nowrap;

}



ul.pager a,

ul.pager li.pager-current {

  border-style: solid;

  border-width: 1px;

  padding: 3px 6px 2px 6px;

  text-decoration: none;

}



ul.pager a:link,

ul.pager a:visited {

  color: inherit;

}



ul.pager a:hover,

ul.pager a:active,

ul.pager a:focus {

  border-style: solid;

  border-width: 1px;

}



ul.pager span.pager-ellipsis {

  padding: 0 4px;

}



.item-list .pager li {

  padding: 0;

}





/* Forms

/-------------------------------------------------------------- */

/* defaults for all text fields */

.form-text {

  padding: 2px;

}



/* defaults for all form buttons */

form input.form-submit {

  cursor: pointer;

  font-weight: bold;

  margin: 2px;

  padding: 3px 5px;

}



form input.form-submit:hover {

  cursor: pointer;

}



fieldset {

  margin: 15px 0;

  padding: 10px;

}



html.js fieldset.collapsed {

  margin-bottom: 15px;

}



/* limit width of form inputs */

textarea,

.form-item input,

.form-item select,

#content-region input.form-text {

  max-width: 95%;

}



html.js textarea {

  max-width: 100%;

}



/* adjust for collapsible fieldset differences */

fieldset.collapsible .resizable-textarea textarea {

  max-width: 101.5%;

}



fieldset.collapsible .resizable-textarea .grippie {

  width: 101%;

}



/* keep admin pages visible */

.page-admin #main-content-inner .nested,

.page-admin #content-group,

.page-admin #content-region,

.page-admin #content-inner {

  margin-bottom: 1.5em;

  overflow: visible;

}



/* keep admin form elements on top */

.page-admin .content-inner-inner {

  z-index: 10;

}



/* theme settings form field width limit */

form#system-theme-settings select,

form#system-theme-settings input.form-text {

  max-width: 95%;

}



/* keep theme select form visible */

#system-themes-form {

  position: relative;

  z-index: 1;

}



/* keep theme switcher visible */

.form-item select#edit-theme {

  max-width: none;

}



/* keep admin columns from dropping under */

div.admin .left,

div.admin .right {

  margin-left: 1%;

  margin-right: 1%;

}



/* region labels on block admin page */

.block-region {

  background-color: #F3F3F3;

  border: 3px dashed #CCCCCC;

  color: #555555;

  font-weight: bold;

  margin: 1px;

  padding: 3px;

  text-align: center;

  text-shadow: 1px 1px #FDFDFD;

  text-transform: uppercase;

  -moz-border-radius: 5px;

  -webkit-border-radius: 5px;

}





/* User Login Form

/-------------------------------------------------------------- */

/* remove centering on login form */

#user-login-form {

  text-align: left; /* LTR */

}



#user-login-form .item-list {

  margin-top: 1em;

}



#user-login-form .item-list ul {

  margin-left: 0; /* LTR */

}



/* remove list styling on login form */

#user-login-form div.item-list ul li {

  list-style-type: none;

  margin: 0;

}



/* adjust openid link (display set in openid.js) */

#user-login-form li.openid-link a,

#user-login li.openid-link a {

  background-position: 0 0;

  padding: 0 0 0 20px;

}



/* User Login Form - Horizontal (Skinr selectable)

/-------------------------------------------------------------- */

.fusion-horiz-login#block-user-0 {

  float: right;

  margin: 20px 0 10px 0;

  position: relative;

}



html.js .fusion-horiz-login#block-user-0 {

  margin-top: 10px;

}



.fusion-horiz-login#block-user-0 h2.title {

  display: none;

}



.fusion-horiz-login#block-user-0 #user-login-form div.form-item,

.fusion-horiz-login#block-user-0 #user-login-form input.form-submit,

.fusion-horiz-login#block-user-0 .item-list {

  float: left;

  margin: 0 10px 0 0;

  text-align: left;

}

--- chopped

2
@Andrew,如果您可以编辑问题,删除整个CSS并仅添加关于“even”或“odd”类以及类别“category”的样式部分,那将非常有用。目前很难跟踪整个样式表。此外,您希望背景颜色是白色还是透明的? - sarcastyx
@Andrew:我对你的问题进行了大量编辑,以恢复一些你原本打算的布局,请花点时间熟悉编辑器和Markdown。 - Orbling
@sarcastyx:CSS文件有点琐碎,FireBug有你需要进行修改所需的文件和类声明。只需要在那个文件中查找那一行并进行更改(因为那是层叠中的最后一个)。 - Brad Christie
@Andrew:我将链接“http://10.0.1.151/sites/default/files/css”保留在原文中,因为它属于一个句子 - 但请注意,这是您个人网络的内部 IP 地址,对于其他人来说不可见 - 是私有网络 - Orbling
@Brad Christie,这正是我所想的。但是我在他的样式表中找不到任何关于tr.even td的提及。这就是为什么我要求一个有限的集合。现在我明白了正在发生的事情。 - sarcastyx
2个回答

7

在您的 /admin/settings/performance 页面中关闭 CSS 聚合。这将使您更清楚地了解 CSS 来自何处。在您的主题的 styles.css 中,您应该能够覆盖它之前的任何内容。换句话说:CSS 来自哪里并不重要,您只需要将想要的 CSS 放入主题的 style.css 文件中即可。


0

所以我认为这取决于您特定的主题,因此如果资源链接是有效的,则会很有帮助。

话虽如此,我在我的网站中找到了tr.even的样式,位置在:

drupal_Folder/themes/the_theme_name_I_am_using/css/style.css

我也相信,如果你将鼠标悬停在蓝色的“css_f4....”项目上,它会显示该特定CSS所在文件的名称。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接