2017-05-29 12 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

あなたの選択オプションリスト内のテキストの色を変更しようとしている場合は、あなたが変更する必要があるテーブルのテキストの色をないthatsの、持っていますこのような質問を見てください。 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> 
関連する問題