2

次のようなCSSがあります。

CSS

table {   
 width: 100%;
 font-family: calibri;
 word-wrap:break-word;
 margin-left: 0; 
 font-size: 1.1em;
 border-collapse: separate;
 border-spacing: 1px;      
}

td {  
 text-transform: none;
 font-weight: bold;
 line-height: 115%;
 word-wrap:break-word;  
 vertical-align: middle; 
 padding: 2px 10px 0 3px ; 
 border-radius: 2px;
 border: 1px solid #6A797F;        
}   

tr:nth-child(odd){
 background-color: #a9c6c9; 
}

tr:nth-child(even){
 background-color: #d4e3e5;
}

<table>別の , <td>&<tr>を CSS ファイルのどこかに追加して、その特定のページのデザインの目的に合わせてスタイルを変更するにはどうすればよいですか。私はこの解決策を試みましたが、うまくいきませんでした:

.members_col1 tr td{
  text-transform: none;
  line-height: 115%;
  word-wrap: break-word;  
  vertical-align: left; 
}

.member_col1は、新しいスタイル セットを追加したい を<div>含むです。<table>

4

2 に答える 2

1

テーブルで属性 ID またはクラスを使用し、CSS でそれらをセレクターとしてカバーします。次に例を示します。

<table id="another-table">...

css
#another-table{
....
}

また

<table class="tables">...
<table class="tables">...

css
.tables{
...
}
于 2012-11-08T20:29:09.803 に答える
0

あなたのhtmlでこれを使用してください:

<table class="newTable">
...
</table>

このCSSを使用します。

.newTable tr td{
   text-transform: none !important;
   line-height: 115% !important;
   word-wrap:break-word !important;  
   vertical-align: left !important; 
   }
于 2012-11-08T20:41:08.700 に答える