Forum Moderators: not2easy

Message Too Old, No Replies

border problems

         

aouaou

8:26 pm on Nov 26, 2004 (gmt 0)

10+ Year Member



Hi

I have trouble with the border function. I want to change color on the bottom and top border of a cell, but it simply won't do it. One matter what color code I enter they are displayed as the color #c0c0c0.

Here is some code exampels:

CSS FILE

.newsitem {
border-bottom: 1px solid #dddddd;
border-top: 1px solid #dddddd;
background-color: #ffffff;

}

.newsimage {
background: url("gfx/news.jpg");
}

HTML FILE

<tr>
<td class="newsimage" height="88" width="130">
</td>
<td class="newsitem" height="88" width="336">
</td>
</tr>

Longhaired Genius

8:30 pm on Nov 26, 2004 (gmt 0)

10+ Year Member



Do you have #c0c0c0 specified somewhere else? Perhaps in the head of your page. Or further down in the same stylesheet.

[edited by: Longhaired_Genius at 8:33 pm (utc) on Nov. 26, 2004]

aouaou

8:32 pm on Nov 26, 2004 (gmt 0)

10+ Year Member



Yes, as body background color

Longhaired Genius

8:40 pm on Nov 26, 2004 (gmt 0)

10+ Year Member



Delink your stylesheet and examine your document in a browser to check for stray styles you may have forgotten about. Then rebuild your stylesheet bit by bit until you find the error. It's important to be calm and methodical when dealing with a problem like this. Check your html and css for validity too.

Eighteen

9:07 pm on Nov 26, 2004 (gmt 0)

10+ Year Member



Hey aouaou:

I might be seeing your problem as more simplistic than it really is but ......

#dddddd and #c0c0c0 are just 2 different shades of gray right?

I set the following in a style sheet for a table cell ...

border-left-width: 2px;
border-left-style: solid;
border-left-color: #c0c0c0;
border-top-width: 2px;
border-top-style: solid;
border-top-color: #dddddd;

and at 2px I had strain my eyes to tell the difference in shades.

Are your eyes just playing tricks on you?

aouaou

9:27 pm on Nov 26, 2004 (gmt 0)

10+ Year Member



The problem is fixed now, I have one question though.
If you set the table height to 80px and the border size to 2 px, will the cell still be 80 px or those border pixels added on the outside?

Eighteen

11:12 pm on Nov 26, 2004 (gmt 0)

10+ Year Member



Try this ...

Make your borders 80px and see if they fill the BOX or tripple the size of the space covered.

If you make a cell height 80px and the border 2px the total space will now be 80 + 2 + 2 = 84px.