View previous topic :: View next topic |
Author |
Topic : "Css Problem" |
AndyT member
Member # Joined: 24 Mar 2002 Posts: 1545 Location: Germany
|
Posted: Mon Nov 10, 2003 10:05 am |
|
 |
A question for the CSS experts:
I have a table with a certain background color.
A cell with a different background color is always surrounded by a border.
What can I do to change that?
I use border-collapse ... padding, border and margin are set to "0". _________________ http://www.conceptworld.org |
|
Back to top |
|
elam member
Member # Joined: 27 Sep 2000 Posts: 456 Location: Motown
|
Posted: Mon Nov 10, 2003 7:13 pm |
|
 |
Couple of ways.
in your style sheet put:
td {
border: none;
}
or in your html put
<td style="border: none;"> .... </td>
for every cell. |
|
Back to top |
|
AndyT member
Member # Joined: 24 Mar 2002 Posts: 1545 Location: Germany
|
Posted: Tue Nov 11, 2003 8:04 am |
|
 |
I tried what you wrote ... guess that would have been a little too easy
That's what it currently looks like (depending on background color):
That's how I want it:
Code: |
BODY
{ color: #000000;
background-color: #EEEEEE;
padding: 0;
margin: 0;
font-family: geneva, lucida, sans-serif, arial;
text-align: center;
}
TABLE
{ border-collapse: collapse;
border: none;
padding: 0;
margin: 0;
font-size: 10pt;
text-align: Center;
vertical-align: Middle;
}
TABLE.main
{ border-collapse: collapse;
background-color: #CCCCCC;
width: 80%;
}
FONT.important
{ color: #FF9900;
font-weight: bold;
font-size: 20pt;
}
DIV
{ text-align: left;
}
FONT.texts
{ color: #000000;
font-size: 11pt;
}
TD
{
border: none;
}
TD.head
{ color: #FFFFFF;
padding: 4pt;
text-align: left;
background-color: #003366;
}
IMG
{ border: 0;
} |
_________________ http://www.conceptworld.org |
|
Back to top |
|
elam member
Member # Joined: 27 Sep 2000 Posts: 456 Location: Motown
|
Posted: Tue Nov 11, 2003 8:44 am |
|
 |
Just curious, did you try viewing these in Mozilla? It has better css support than IE, so I always test my pages in that first.
I did a quick test of the css u posted, using the classes for td and table, and I'm not getting borders. Maybe u could post the relevant HTML? |
|
Back to top |
|
gLitterbug member
Member # Joined: 13 Feb 2001 Posts: 1340 Location: Austria
|
Posted: Tue Nov 11, 2003 8:58 am |
|
 |
nevermind |
|
Back to top |
|
AndyT member
Member # Joined: 24 Mar 2002 Posts: 1545 Location: Germany
|
Posted: Tue Nov 11, 2003 9:20 am |
|
 |
elam: Thanks ... good to know!
I'll play a little with the HTML part myself ...
I tried it with IE (CrazyBrowser), NS, Opera and Mozilla Firebird.
gLitterbug:
Ok!
Code: |
<td align="center"><br />
<table bgcolor="#003366" width="95%" align="center">
<tr>
<td bgcolor="#CCCCCC"><div><font class="texts"><b>Text</b></font></div></td>
<td width="200px" style="border: none;"><img src="skin/static/content_eng.gif" alt="Content"></img></td>
</tr>
<tr>
<td bgcolor="#CCCCCC"><div><font class="texts">Text<br />
</font></div></td>
<td class="head">HTML / CSS<br />Php / MySql<br />Javascript<br />Flash</td>
</tr>
</table><br />
</td> |
The table is blue but on a gray background.
The bg of the image is gray. The same happens if the bg of the cell is gray. _________________ http://www.conceptworld.org |
|
Back to top |
|
elam member
Member # Joined: 27 Sep 2000 Posts: 456 Location: Motown
|
Posted: Tue Nov 11, 2003 9:31 am |
|
 |
No borders for me, with or without a color change.
Could be that you have unmatched closing tags somwhere, like a missing </div>
Kinda hard to trouble shoot these things without seeing the enitire page. Gotta url? |
|
Back to top |
|
AndyT member
Member # Joined: 24 Mar 2002 Posts: 1545 Location: Germany
|
|
Back to top |
|
elam member
Member # Joined: 27 Sep 2000 Posts: 456 Location: Motown
|
Posted: Tue Nov 11, 2003 9:53 am |
|
 |
No laughs here! Looks good.
The problem is the 'border' thats appearing is due to the padding in the cell. Theres no actual border, its just the underlying background color of the table showing through.
Add a style="padding: 0px;" to the offending cell. Should disappear. |
|
Back to top |
|
AndyT member
Member # Joined: 24 Mar 2002 Posts: 1545 Location: Germany
|
Posted: Tue Nov 11, 2003 10:27 am |
|
 |
D'oh! Thanks!!!!
Must be the only thing I haven't tried.
I thought padding: 0; for the whole table would affect all cells.
Quote: |
No laughs here! Looks good. |
Thanks again  _________________ http://www.conceptworld.org |
|
Back to top |
|
|