开发者

Override body property

开发者 https://www.devze.com 2023-03-02 20:00 出处:网络
I have body { color: #6969开发者_开发知识库69; } and th.somelist { font-weight: bold; color: red; } but the color property of body is not overridden.

I have

body
{
    color: #6969开发者_开发知识库69;
}

and

th.somelist
{
    font-weight: bold;
    color: red;
}

but the color property of body is not overridden. How come, and how can I make it override the body selector?

Edit:

I also have

table.somelist
{
    padding: 10px;
    background-color: green;
    border-radius: 15px;
}

and the code is

<table class="somelist">
    <tr>
        <th class="somelist">
            Top 10
        </th>
    </tr>

    <tr>
        <td> 1. </td>
    </tr>
</table>

The th text is bold but #696969 and not red.


<html><head><title>test</title>
<style>
body
{
    color: #696969;
}
th.somelist 
{
    font-weight: bold;
    color: red;
}
</style>
</head>
<body>
testing...
<table><tr><th class="somelist">should be red</th></tr>
<tr><th>should not be red</th></tr>
</table>
</body>
</html>

works on Chrome and Firefox.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号