2017-05-29 33 views
0

如何更改html表格中的字體顏色?如何更改html表格中的字體顏色?

<table> 
<tbody> 
<tr> 
<td> 
<select name="test"> 
<option value="Basic">Basic : $30.00 USD - yearly</option> 
<option value="Sustaining">Sustaining : $60.00 USD - yearly</option> 
<option value="Supporting">Supporting : $120.00 USD - yearly</option> 
</select> 
</td> 
</tr> 
</tbody> 
</table> 

我曾經在多個位置......這不行試過

<span style="color: #0000ff;"> 
</span> 

+0

如果你想改變文本的顏色在你的選擇列表選項,那不是你需要更改表文本顏色,有看看這個類似的問題。 https://stackoverflow.com/questions/15755770/change-text-color-of-selected-option-in-a-select-box – Steveland83

回答

1
<table> 
<tbody> 
<tr> 
<td> 
<select name="test" style="color: red;"> 
<option value="Basic">Basic : $30.00 USD - yearly</option> 
<option value="Sustaining">Sustaining : $60.00 USD - yearly</option> 
<option value="Supporting">Supporting : $120.00 USD - yearly</option> 
</select> 
</td> 
</tr> 
</tbody> 
</table> 
0

,如果你需要從選擇菜單更改特定選項 你可以做這樣的

option[value="Basic"] { 
    color:red; 
} 

,或者你可以改變它們的所有

select { 
    color:red; 
} 
1

這樣的事情,如果想要去老套。

<font color="blue">Sustaining : $60.00 USD - yearly</font> 

雖然更先進的方法是使用CSS樣式:

<td style="color:#0000ff>Sustaining : $60.00 USD - yearly</td> 

當然也有更普遍的方式來做到這一點。

0
table td{ 
    color:#0000ff; 
} 

<table> 
    <tbody> 
    <tr> 
    <td> 
     <select name="test"> 
     <option value="Basic">Basic : $30.00 USD - yearly</option> 
     <option value="Sustaining">Sustaining : $60.00 USD - yearly</option> 
     <option value="Supporting">Supporting : $120.00 USD - yearly</option> 
     </select> 
    </td> 
    </tr> 
    </tbody> 
</table> 
0

試試這個:

<html> 
    <head> 
     <style> 
      select { 
       height: 30px; 
       color: #0000ff; 
      } 
     </style> 
    </head> 
    <body> 
     <table> 
      <tbody> 
       <tr> 
        <td> 
         <select name="test"> 
          <option value="Basic">Basic : $30.00 USD - yearly</option> 
          <option value="Sustaining">Sustaining : $60.00 USD - yearly</option> 
          <option value="Supporting">Supporting : $120.00 USD - yearly</option> 
         </select> 
        </td> 
       </tr> 
      </tbody> 
     </table> 
    </body> 
</html>