Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
css表获取错误的属性_Css - Fatal编程技术网

css表获取错误的属性

css表获取错误的属性,css,Css,我建了一张桌子,在它的一排上面是这样的 <tr id="graphid+'" class="graphRow"> <td colspan="2" style="width:5%; max-width:5%;"> <div class="stockData"> <div class="stockDatatable">

我建了一张桌子,在它的一排上面是这样的

<tr id="graphid+'" class="graphRow">
                <td colspan="2" style="width:5%; max-width:5%;">
                    <div class="stockData">
                        <div class="stockDatatable">
                            <table class="stocktable">
                                <tr><td id="stockDBnameid+'"></td></tr>
                                <tr><td class="Desctitle">תחום עיסוק:</td></tr>
                                <tr><td id="stockDBfieldid+'" class="stocktable"></td></tr>
                                <tr><td id="stockDBurlid+'" class="stocktable">כתובת אתר החברה</td></tr>
                                <tr><td class="Desctitle">ערך החברה:</td></tr>
                                <tr><td id="stockDBvalueid+'" class="stocktable">ערך החברה</td></tr>
                                <tr><td id="stockDBdescid+'" class="stocktable">תיאור המנייה</td></tr>
                            </table>
                        </div>
                    </div>
                </td>
                <td colspan="8">
                    <table>
                        <tr>
                            <td>
                                <div id="graphDivid+'" class="GraphDiv"></div>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
为什么它不工作


谢谢。

根据您的声明
tr.stocktable td{background:blue;}
,stocktable仅适用于tr。但您已将stocktable用于

声明类似于-

.stocktable{背景:蓝色;}


table.stocktable{background:blue;}

我找不到类为
stocktable
tr
元素,但您有一个包含此类的表。为什么要将“stocktable”应用于表和td标记???根据您的样式定义,您应该将其应用于内部表的tr标记。此外,请注意不要像在问题文本中那样在源代码中酸性地写“stockTable”。
tr.graphRow td {background:lightgray;}
tr.stocktable td {background:blue;}