Colours of <th> on tables

  • Thread starter Luigi Donatello Asero
  • Start date
L

Luigi Donatello Asero

On the table with the name of the regions of Italy and main towns of these
regions which I have written in German and Italian
on the following page
http://www.scaiecat-spa-gigi.com/de/ferienwohnungeninitalien.html
I used different background colours depending on where the regions are
situated.
The brown background is dark and I wonder whether I could use different
colours for <th> and then having
<th1> th2> and so on for the headers of the table using CSS.
Also I wonder how many users can see more than 256 colours on their computer
screens.
 
L

Luigi Donatello Asero

2a7 said:
Are you looking for CSS code to colour the approriate table headers?
I thought that this should word and make the <th class="four">
white but it does not.
******************************
..four {
color:#ffffff; border: 1px solid white;
background: #cc6600;}
******************************

Here is the relative style sheet
p{
margin-bottom: 2%;
margin-top: 2%;
text-indent:5%;
text-align: left;
margin-left:10%;
margin-right:10%;
}


TABLE { border-collapse: separate;
border: 1px solid red;
}

..one {color:#000000; border: 1px solid white;
background: #ffffff;}
..two {color:#000000; border: 1px solid white;
background: #33ffcc;}
..three {color:#000000; border: 1px solid white;
background: #99ff66;}
..four {
color:#ffffff; border: 1px solid white;
background: #cc6600;}
..five {color:#ffffff;
border: 1px solid white;
background: #ff0099;}






th, li, h1, h2, h3, a {
color: black;
background: transparent;
text-align:center;
}
..four {
color:#ffffff; border: 1px solid white;
background: #cc6600;}
body {
background: #ffffcc;
color: black;
font-size: 100%;
margin: 0;}
#head{border:0px solid white;}

#content{
margin-left:auto;
border:1px solid green;}
DIV.normal{margin-top: 5%;


}
div#menu{color:#000000;
background:#ffffcc;
width:33ex;



border:1px solid white;
text-align:center;



float:left;}
#menu a {
margin-left:auto;
margin-right: auto;
color: #0000ff;
background:#ffcc66;

border-left: 1px solid #F66460;
border-top: 1px solid #F66460;
border-right: 1px solid #000000;
border-bottom: 1px solid #000000;
width: 80%;


margin-top: 5px;

display: block;}

#menu a:active {color: #0000ff; background-color:#ffffff; }
#menu a:visited {color: #000000; background-color:#ffffff;}
#menu a:hover {
color: #666666;
background-color:#ffffff;
border-left: 1px solid #000000;
border-top: 1px solid #000000;
border-right: 1px solid #F66460;
border-bottom: 1px solid #F66460;}
div.top {margin-top: 2%;
margin-left: auto;
margin-right:auto;
text-align:center;
}
div.bottom {margin-bottom: 2%;
margin-left: auto;
margin-right:auto;
width:100%
}
div.provinser{
margin:auto;
padding:0;
text-align:center;
width:50%;
}
div.semesterboende{
margin:auto;
padding:0;

width:78%;
}

ul {
margin:auto;
list-style-type:none;
}
ul.languages{
margin:auto;
list-style-type:square;}
li.menu {
display:inline;
}
 
L

Luigi Donatello Asero

Luigi Donatello Asero said:
I thought that this should work and make the <th class="four">
white but it does not.
******************************
.four {
color:#ffffff; border: 1px solid white;
background: #cc6600;}
******************************

Here is the relative style sheet
p{
margin-bottom: 2%;
margin-top: 2%;
text-indent:5%;
text-align: left;
margin-left:10%;
margin-right:10%;
}


TABLE { border-collapse: separate;
border: 1px solid red;
}

.one {color:#000000; border: 1px solid white;
background: #ffffff;}
.two {color:#000000; border: 1px solid white;
background: #33ffcc;}
.three {color:#000000; border: 1px solid white;
background: #99ff66;}
.four {
color:#ffffff; border: 1px solid white;
background: #cc6600;}
.five {color:#ffffff;
border: 1px solid white;
background: #ff0099;}






th, li, h1, h2, h3, a {
color: black;
background: transparent;
text-align:center;
}
.four {
color:#ffffff; border: 1px solid white;
background: #cc6600;}
body {
background: #ffffcc;
color: black;
font-size: 100%;
margin: 0;}
#head{border:0px solid white;}

#content{
margin-left:auto;
border:1px solid green;}
DIV.normal{margin-top: 5%;


}
div#menu{color:#000000;
background:#ffffcc;
width:33ex;



border:1px solid white;
text-align:center;



float:left;}
#menu a {
margin-left:auto;
margin-right: auto;
color: #0000ff;
background:#ffcc66;

border-left: 1px solid #F66460;
border-top: 1px solid #F66460;
border-right: 1px solid #000000;
border-bottom: 1px solid #000000;
width: 80%;


margin-top: 5px;

display: block;}

#menu a:active {color: #0000ff; background-color:#ffffff; }
#menu a:visited {color: #000000; background-color:#ffffff;}
#menu a:hover {
color: #666666;
background-color:#ffffff;
border-left: 1px solid #000000;
border-top: 1px solid #000000;
border-right: 1px solid #F66460;
border-bottom: 1px solid #F66460;}
div.top {margin-top: 2%;
margin-left: auto;
margin-right:auto;
text-align:center;
}
div.bottom {margin-bottom: 2%;
margin-left: auto;
margin-right:auto;
width:100%
}
div.provinser{
margin:auto;
padding:0;
text-align:center;
width:50%;
}
div.semesterboende{
margin:auto;
padding:0;

width:78%;
}

ul {
margin:auto;
list-style-type:none;
}
ul.languages{
margin:auto;
list-style-type:square;}
li.menu {
display:inline;
}
 
L

Luigi Donatello Asero

I also tried to use it as a id selector and write
th, li, h1, h2, h3, a {
color: black;
background: transparent;
text-align:center;
}
#four {
color:#ffffff; border: 1px solid white;
background: #cc6600;}

Yet it does not work
 
F

Foofy (formerly known as Spaghetti)

The brown background is dark and I wonder whether I could use different
colours for <th> and then having
<th1> th2> and so on for the headers of the table using CSS.

If you are trying to make the color of the links in the brown cells white,
you need to style the a element, since a does not inherit the colors from
the parent.

..four a:link { color: #FFFFFF; }
Also I wonder how many users can see more than 256 colours on their
computer screens.

Most users use 16-bit color or higher. 8-bit color (256) is uncommon, and
there aren't enough to worry about. If you take care of your color
contrast, you shouldn't have to worry about your site being unusable on
8-bit color machines.
 
L

Luigi Donatello Asero

Foofy (formerly known as Spaghetti) said:
If you are trying to make the color of the links in the brown cells white,
you need to style the a element, since a does not inherit the colors from
the parent.

.four a:link { color: #FFFFFF; }

Thank you.
http://www.scaiecat-spa-gigi.com/de/ferienwohnungen.html
Most users use 16-bit color or higher. 8-bit color (256) is uncommon, and
there aren't enough to worry about. If you take care of your color
contrast, you shouldn't have to worry about your site being unusable on
8-bit color machines.
How many colours does 16-bit color correspond to?
 
F

Foofy (formerly known as Spaghetti)

How many colours does 16-bit color correspond to?

16-bit color (AKA "thousands of colors") can do 65,536 colors.
32-bit color (AKA "millions of colors") can do 4,294,967,296, which is
quite a bit over a million anyway!

32-bit color can produce more colors than the human eye can even discern,
and produces all images and gradients perfectly (as far as the human eye
is concerned!) 16-bit color is almost as good but it fails on tougher
gradients which causes banding or dithering. There is some 24-bit color
chips too, but they are only marginally better than 16-bit.
 
W

Wÿrm

32-bit color (AKA "millions of colors") can do 4,294,967,296, which is
quite a bit over a million anyway!

Actually 32-bit "color mode" is in reality 24-bit color. 8 bits for each:
red, green, and blue components. Rest 8 bits are not used typically, unless
there's alpha channel stored to that. So 32-bit mode gives still only that
over 16 million colors or so.

There is some 24-bit color
chips too, but they are only marginally better than 16-bit.

Wrong. 24-bit desktop color gives same result as "32-bit" but it is not
wasting extra 8 bits.

Reason for using 32-bit instead 24-bit is that accessing memory on 32-bit
aligned boundary is faster than 24bit aligned boundary.
 
O

O Ransen

16-bit color (AKA "thousands of colors") can do 65,536 colors.
32-bit color (AKA "millions of colors") can do 4,294,967,296, which is
quite a bit over a million anyway!

32-bit color can produce more colors than the human eye can even discern,

Not quite true. from 24 bit upwards it depends on the range of the
device you are showing the image on. Color monitors are bad at pure
reds and cyan, for example, and presumably printers have different
problems, and LCD monitors others.



Unique and easy to use graphics programs
http://www.ransen.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,436
Messages
2,571,696
Members
48,796
Latest member
Greg L.
Top