开发者

Styling of h2 tag does not seem to be working

开发者 https://www.devze.com 2023-04-10 15:47 出处:网络
I just added a style for an H2 tag like this: 开发者_JAVA技巧h2.section_header { color: #1C1C1C; font-family:gisha,serif;

I just added a style for an H2 tag like this:

开发者_JAVA技巧
h2.section_header
{
    color: #1C1C1C;
    font-family:gisha,serif;
}

and in my HTML I am trying to reference it like this:

<h2 clas="section_header">Most Popular Problems</h2>

But it does not seem to be changing the color to the one I specified. Any idea what I could be doing wrong?

Thanks!


You mis-spelled class in the tag.


<h2 clas="section_header"

This has a typo in and should read:

<h2 class="section_header"


The CSS code "font-family" is the right code to style a font/characters.

The other behavior of "font-family" is trying to style the font/characters of your first declared font family which is "geisha". If your computer does not support of that font style. The second declared font family will be used which is "serif".

Sans serif, serif and monospace are the generic font family which is supported to all computers.

0

精彩评论

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