Home > Back-end >  <input type="button"> doesn't inherit the font-family
<input type="button"> doesn't inherit the font-family

Time:10-07

Hi everyone, I have a question, hope it helps

with code

.common{
    font-family: "MS Pゴシック";
    color:#FFFFFF;
}
<table>
    <tr>
        <td  >
            <input type="button" value=button> 
        </td>
    </tr>
</table>

On Chrome buttons do not inherit font-family of <td>

On IE buttons inherit font-family of <td> , but do not inherit color: #FFFFFF of <td>

Why is there this difference?

CodePudding user response:

You can specified it with:

table tr td .common{
    font-family: "MS Pゴシック";
    color:#FFFFFF;
}

CodePudding user response:

It's normal that your button doesn't inherit from the parent CSS because the button already has an assigned CSS (you can see it when you inspect your element online). This assigned CSS is different depending on the web browsers. So you have to force the css as @Amri advised you.

  • Related