system.css Causes Floating Line on Non-Themed Tables in Firefox

rszrama - October 26, 2006 - 17:34
Project:Drupal
Version:5.1
Component:system.module
Category:bug report
Priority:minor
Assigned:Unassigned
Status:duplicate
Description

The following CSS in system.css is the offending party:

tbody {
  border-top: 1px solid #ccc;
}

Here's the deal... if you're not using theme_table() or theme() but creating your own table to display some content, Firefox automatically injects the tbody element whether you put it in your code or not. (IE leaves it alone, so this problem is Firefox specific as far as I can tell.) So all my custom tables have that silly 1px border on the top, and it just makes them look off. : P

I'm not sure of the exact solution here, because I'm assuming that was left in to be combined with the table row's bottom border to frame the table rows nicely... but it still seems like a style mistake given the tr's require the odd or even class to have the bottom border.

For now I've just commented out the tbody top border, and I'm curious if that's not the best solution for the module's stylesheet to take... remove it altogether. It seems Drupal rarely uses tables w/o a header row, and that header row always has the bottom border set to frame the table rows.

(The other, seemingly more unwieldy solution, is for me to create my own tbody class that sets the top border to none and apply that to all my custom tables...)

#1

digitaldragon - March 12, 2007 - 19:06
Version:x.y.z» 5.1

I also found this to be quite irritating. I spent a half hour trying to find the cause of that border.

#2

bwynants - March 14, 2007 - 12:37

yep, found that too. but a little bit faster thanks to firebug :-) https://addons.mozilla.org/firefox/1843/

#3

underpressure - August 2, 2007 - 15:34

yeah I have the same problem and found it with firebug.

#4

scarer - January 15, 2008 - 06:39

where is this system.css file?

ah i found it. thanks heaps for the tip.

#5

ScoutBaker - January 15, 2008 - 06:43

@scarer: The file is found in /modules/system.

#6

underpressure - January 15, 2008 - 20:17

Do not alter Drupal core files, every time you upgrade to a newer version you will have to alter the file again, instead what you do is add the snippet of CSS to your themes .css file.

#7

Crackwood - January 17, 2008 - 19:18

underpressure - Thanks for the heads up, but I don't completely understand. I thought the suggestion was to comment out a line of code, but you are saying to add code to the themes.css file...?... Would you mind expanding? I am a relative newb to style sheets, so I don't mind details. :P :D Thanks!

UPDATE: Ok, I fixed it with the themes style.css file (not the themes.css file, which I don't think exists :P I thought you mistakenly put the space in between theme and .css). What I did was copy the tbody code from the system.css file: tbody{border-top: 1px solid #ccc;} - then pasted it into the style.css file from the directory of the theme I am using. After changing the '1px' in the code to '0px' the floating line disapeared!

Anyhow, thanks again for the heads up.

#8

webernet - January 17, 2008 - 19:54
Status:active» duplicate

http://drupal.org/node/93357

#9

underpressure - January 17, 2008 - 20:48

let me break it down for you.

Most themes (I believe) use a style.css as the default CSS for the theme. When I said "theme's .css" I was saying the CSS file in your theme's folder not theme.css since I didn't know what your theme CSS was style.css or not.

The reason you add the bit of CSS to your style.css instead of editing your system.css is firstly you shouldn't mess around with the core files one of the main reason is you'll have problems when upgrading to a newer version of Drupal when the times comes. Secondly (in a nutshell) Drupal will give priority to you theme's CSS file if it and the core system.css file have the same code.

What ever customizing you want to do to the look of Drupal should be done in you themes folder and not by editing the core files, please take a look at the handbook pages to get a better understanding of Drupal.

There are also books about drupal available and some are available as eBooks which are free to download on torrent sites.

#10

bwynants - January 23, 2008 - 10:34

@webernet: Shouldn't you mark the newest one as duplicat? This one was entered before http://drupal.org/node/93357

#11

pelicani - February 8, 2008 - 16:30

Thanks for the heads up!!!
I need to start using my debug more often.
Also occurs in Safari.

#12

ehart - June 26, 2008 - 19:51

Thanks so much!

 
 

Drupal is a registered trademark of Dries Buytaert.